Reputation: 145
when editing a specific record in a listview row, how do I get that value to the corresponding combobox selected item/value?
The combobox is in dropdownlist style mode, so the selected text wont work.
i tried this:
cbBrand.SelectedItem = lvMain.SelectedItems[0].SubItems[1].ToString();
but i get null
in the corresponding combobox selecteditem... :(
Upvotes: 0
Views: 2658
Reputation: 145
I got it working like this:
int xcb;
xcb = this.cbBrand.FindString(lvMain.SelectedItems[0].SubItems[1].Text);
this.cbBrand.SelectedIndex = xcb;
Upvotes: 1