Hello, I have a datatable and when I assign it as the datasource to a
combo box it causes the SelectedIndexChanged event to fire - obviously
I only want SelectedIndexChanged event to fire when the user makes a
change.
See:
http://geekswithblogs.net/mnf/archiv.../25/57979.aspx
So, I want to use the combobox.Items.AddRange() method or just Add()
method instead. However, I need both the DisplayText and DisplayValue
(not shown) to be added. The DisplayText is a string and the
DisplayValue needs to be an int (a PK from the table)
What is the best way to do this?
a) convert the datatable into datarows?
b) loop thru the datatable and create a collection? which one holds
two different value types?
c) linq ?
I would appreciate some example code as I learn better from seeing
code.
TIA,
G