Hi,We are using a Xamgrid binded to a list of objects from ViewModel.When a property of one of the objects is updated, the Xamgrid is not reflected the changes.We already tried to use InvalidateData().This works as data are updated in the Xamgrid, but it as side effects.In one of the column, we have an unbound column with a button.Text of the button is changing when user click on it.When InvalidateData() is called several times (each time data has been modified), buttons are not displayed correctly as their position (or just text display) change.In attachment, you will find a solution showing the problem.Each 3 seconds, the lastname of second person in the Xamgrid is updated.So 2 scenarios : - Whithout InvalidateData() [line 58 in code-behind] : nothing change in the grid => not as expected - Whith InvalidateData() : date are updated in the grid (good). Then if you click on button of 1rst line, its text change as expected but after 3 seconds, the text is swapping between 1rst and 3rd line => not really as expected.
Now 2 questions : 1 - Is there a way in our situation to have grid updated without using InvalidateData() ? (why InvalidateData() is needed even if binding is redo ?) 2 - If InvalidateData() is mandatory, how to prevent grid to switch data between lines on screen ? Thanks for your help.Alain.
Hi,
After more investigation, we found a solution : RaiseDataMemberChanged.
We had this problem because the View is informed when the object itself is updated (NotifyPropertyChanged) but not when one of the attributes is modified.
Solution :
See complete solution in attachment.
Hope this will help other people.
Alain.