Richard
asked on
VB.NET comboBox databinding
I would like to set a combobox datasource to evaluate an enum such that the dropdown lists the Text Values and the Selected Index reflects the integer value. Found that worked ok... but the problem I have is I want the Selected Index bound to a datarow. So when the user picks another text value in the combobox the index is pushed to the datarow.
The code below works ok but the combobox pushes the Text value to the datarow. How to I code it such that the combo selectedindex is updated to the datarow rather than the text value.
cmbPlane.DataBindings.Add( "Text", drCurrent, "Plane")
cmbPlane.DataSource = System.Enum.GetValues(GetT ype(EcCplP lanes))
The code below works ok but the combobox pushes the Text value to the datarow. How to I code it such that the combo selectedindex is updated to the datarow rather than the text value.
cmbPlane.DataBindings.Add(
cmbPlane.DataSource = System.Enum.GetValues(GetT
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
My problem actually turned out to be that I was binding the selectedindex to a datarow with a value before binding the datasource
So the belows seems to work ok...
cmbPlane.DataSource = System.Enum.GetValues(GetT
cmbPlane.DataBindings.Add(