Listbox Databinding and Value/Index change

dsk96m

Well-known member
Joined
Jan 11, 2013
Messages
173
Programming Experience
1-3
I have a listbox on a form. During my form load event i bind the listbox to a datasource. This works just fine. I also set selected item to nothing so that nothing is selected. My problem is that after the form loads and I want to select an item from a list, what do I choose for the event. If i use selecteditem or value or whatever changed, then during the load event any of these are run when i set the binding.

How do i set it up correctly. Am i binding the data at the wrong point? the list box doesnt have a selecteditemcommitted event, so what do I do?
 
Just use SelectedIndexChanged and use a Boolean field to decide whether to respond or not. You can change the value of that field in the Load event handler so only events raised after that will result in any action.
 
Back
Top