Binding a listbox in WPF

Joined
Jan 10, 2007
Messages
43,898
Location
In The Machine
Hey all - I must be having a bad day.

I'm trying to bind a WPF listbox to an ADO.Net Datatable.

I have a listbox, and have the the ItemsSource property to my datatable's Rows collection.

That works fine, I get my records returned etc and all is well..... but if I add a new row to the collection, the Listbox does not get updated, nor if I remove a row etc.

In order to refresh the listbox, I have to set the ItemsSource property again, which I'm sure is not the right way to go about this.

I think I must be missing something, but would really appreciate a nudge in the right direction :-)


More...

View All Our Microsft Related Feeds
 
Back
Top