Updating listbox bound to IList

  • Thread starter Thread starter Brian Mitchell
  • Start date Start date
B

Brian Mitchell

Hello, I am trying to update my listbox whenever I remove something from the
underlying datasource (IList). I understand that you must use the
SuspendBinding and ResumeBinding methods of the BindingContext to accomplish
this but I think I am doing something wrong:

Dim bc As BindingManagerBase = BindingContext(MyClass)
bc.SuspendBinding()
MyClass.Remove(ListBox1.SelectedItem)
bc.ResumeBinding()

The item is getting removed from my class but the listbox never updates.

Am I using the BindingContext incorrectly?

Thanks!!
 
Hi Brian,

Is it absolutly necessary to use an Ilist.
When you use the datatable binded to a dataview (which is very easy to make
also without an underlaying database table) most things are working much
easier.

(Why easier, just because you can also very easy use the datavalue from the
listbox and the benefits of the dataview as sorting and hidding)

Just my thoughts?

Cor
 
Back
Top