Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
190
How do I select databound item
posted

I have a wbdropdown control that I have bound in the code behind.  When I try to set a selected item so that it is the item that is displayed in the text box I use this code.

  Me.myDDL.FindItemByValue("x").Selected = True

Where x is set to the correct value.  I get an error stating that the object is not set to a vlaue.  Using a watch I can see that the items collection is empty, but if I let the code run the drop down list is populated.

If I set the binding at design time I don't the issue where the object is not set to a value.  But I don't get the text displaying in the text field.

I am looking for any way to set the text field of the drop down with an item from the list. 

Thanks in advance.