0

am developing a windows phone which contains database.I've a list box which binds observable collection to display the data retrieved from database. I am able to add and delete rows without any problem.After add or delete, listbox gets updated. But when i update a particular column, updating is working fine in database but in the display page i.e in listbox updated value is not reflected. To see the changes in database i need to relaunch the application.

Can any one tell me how to bind listbox at run time.

sushma
  • 1
  • In addition to INotifyPropertyChanged, you'll need to use a 'true' ObservableCollection: http://stackoverflow.com/questions/269073/observablecollection-that-also-monitors-changes-on-the-elements-in-collection – William Melani Mar 29 '12 at 15:24

2 Answers2

0

To reflect the changes of the properties, you need to implement the INotifyPropertyChanged interface in your data model class.
So whenever the value of a property is changed you call the NotifyPropertyChanged() function, which will tell the binded UI Element to update its value.

Amresh Kumar
  • 1,445
  • 17
  • 30
0

The ObservableCollection just ensures that the binded listbox gets updated when an item gets added or deleted from it.

In order to see changes in a particular item, the item class must implement the INotifyPropertyChanged interface!

Pedro Lamas
  • 7,185
  • 4
  • 27
  • 35