K
kadams1
Greetings:
I'm have a WinForm in VB.Net that has several simple controls,
specifically Comboboxes, that are data bound. I want to perform a search
on the bound data (NOT on the values in the Combobox), find a particular
row in the Dataset, and make the corresponding entry in the Combobox
become selected.
A Dataset.<tablename>.Rows.Find returns a DataRow. Combobox.SelectItem
expects a DataRowView, so that won't work. And unless I'm missing
something, there is no Combobox.Find that will search on arbitrary fields
in the datasource.
I can see kludgy ways to do this, for example using the data from the row
returned by the search to create a value string that can be used to search
the Combobox. But this is not only inelegant, it could be downright wrong
in the situation where the values displayed in the combobox are, for
example, not unique to the data rows.
Thoughts?
Kelly
I'm have a WinForm in VB.Net that has several simple controls,
specifically Comboboxes, that are data bound. I want to perform a search
on the bound data (NOT on the values in the Combobox), find a particular
row in the Dataset, and make the corresponding entry in the Combobox
become selected.
A Dataset.<tablename>.Rows.Find returns a DataRow. Combobox.SelectItem
expects a DataRowView, so that won't work. And unless I'm missing
something, there is no Combobox.Find that will search on arbitrary fields
in the datasource.
I can see kludgy ways to do this, for example using the data from the row
returned by the search to create a value string that can be used to search
the Combobox. But this is not only inelegant, it could be downright wrong
in the situation where the values displayed in the combobox are, for
example, not unique to the data rows.
Thoughts?
Kelly