AnonymousCoder
AnonymousCoder

Reputation: 592

Windows Store App update GridView

How to update the contents of GridView. ie initially I bind data to GridView & once I have updated the database I have to clear the existing items and bind updated items.

Upvotes: 1

Views: 652

Answers (1)

Damir Arh
Damir Arh

Reputation: 17865

You say you are already binding the GridView? In this case you have two options:

  1. You can bind it to an ObservableCollection which will notify the UI when it changes. This means you can just clear this collection to remove the old items and then add the new updated items to it.

  2. Alternatively you can implement INotifyPropertyChanged on the class containing the collection you are binding the GridView to, and raise PropertyChanged when you replace the collection containing the old items with a new collection containing the updated items.

It would be easier to help you if you would post some code showing what you're currently doing.

Upvotes: 1

Related Questions