Databinding a comboList to a DataView
Posted on 2006-04-15
I have a dataview containing rows of data. The data, lets say, contains a number of categories (several in category1, a couple in category2 etc). On my form, I have different comboBoxes for each category for which I want to list.
How do I, through databinding, list the data in each category to their respective comboBoxes? I think I'm nearly there, just need help at ????
What I have so far:
MyDataView.RowFilter = "CategoryColumn = 'CategoryValue'"
ComboBox1.DataBindings.Add("????", MyDataView, "DataViewColumn")
'repeat the above changing the Category and ComboBox's accordingly
If I replace ???? with:
- "Text", I just get the first row
- "Items" throws an exception as the Items property is read only
- "DisplayMember" nothing