Winforms Combobox SelectedValue is Null

前端 未结 3 1273
心在旅途
心在旅途 2020-12-11 18:35

I have a data entry form that had several comboboxes on it. Each of the combo boxes has its own binding source and it is populating correctly when I launch the form. Howev

相关标签:
3条回答
  • 2020-12-11 18:35

    ComboBox has to have DataSource. Link data though ComboBox1.DataSource

    0 讨论(0)
  • 2020-12-11 18:46

    Maybe, you just need to use the SelectedItem, instead!

    0 讨论(0)
  • 2020-12-11 18:47

    Are you using a DropDownStyle of DropDown and typing into the ComboBox? If so, that will cause SelectedValue to be null, I'm assuming because the value entered is no longer one of the items in the ComboBox.

    If this is the case, set the DropDownStyle to DropDownList, assuming the user has to pick an existing value.

    0 讨论(0)
提交回复
热议问题