Hello I have a listbox that is bound to a bindingsource bsDATA; my text boxes on the form are also bound to this same datasource. the Listbox DisplayValue = IDfield, DisplayMember = Namefield. My textbox is databound to the Namefield (so it can be edited). The advantage is changes are seen in both the listbox and the textbox, The problem is the SelectedIndexChanged event fires when simply the value of the Namefield is changed by the textbox, which causes the listbox to rebind . I have code that must only run if they change the index from the listbox.
How can I decouple these two components, so the user can change the text in the textbox and not fire the selected indexchanged event, and if the user should change the selected index - I can check my IsDirtyFlag and post a message saying you can't do that unless you answer my questions as to what you want to do , ie discard or save changes. I thought while writing this to use the Who has focus check [for example if listbox has focus change the index, if not skip it , not sure if that is a good way or not. What is the best way to handle this situation?