selecting a combobox item at runtime.
Posted on 2007-10-14
I am using a combBox, I want to select an item at runtime. When the form is loading the combbox is populated with values. At one time I have to populate the form with data from the database. When editing is done on the form it should replace the original form. below is a line from my code.
Me.tlevel.Text = gcl.ReturnLevel(drd("tlevel"))
tlevel is a combobox, drd("tlevel") is a level id from a datareader "drd". actually it the (index of the selected item in the combobox) + 1, so gcl.ReturnLevel(drd("tlevel")) displays the label for that index. But as it is loading I want it also selected because when iam saving i read the (id of the selected item) + 1 and i save that value. i use structures to populate the combobox. I am using vb.net.