troubleshooting Question

VB.NET comboBox databinding

Avatar of guilloryt
guilloryt asked on
Visual Basic.NET
2 Comments1 Solution965 ViewsLast Modified:
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(GetType(EcCplPlanes))
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros