c# - Update Listbox -


I have built a listback for this SQL CE database with this code:

  ItemsSource = "{Binding relative Soros = {relative saras FindAncestor, ancestors type = {x: type local: database window}}, path = database.photo 1}"  

This list box is populated properly But when I try to put a line in the database (InsertOnSubmit + SubmitChagnes), the listbox is not updated!

I have tried:

  ListBox.Items.Refresh (); ListBox.GetBindingExpression (ListBox.ItemsSourceProperty) .UpdateTarget (); ListBox.ItemsSource = null; ListBox.ItemsSource = this.Database.Table;  

None of these help me how can I update the listbox ?!

PS: After reloading the database, the row appears in the list box. PPS: If anyone knows the tutorial for SQL CE with WPF where the inclusion in the listbox is shown - it would be great!

Ensure that the item you are applying to an item source is converted to InotifyCollectionChanged. (For example, you can put your items in an Observeable Collection) In addition, to be reflected for changes in your impractical objects, you have to implement INotifyPropertyChanged.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -