This is a migrated thread and some comments may be shown as answers.

Update single property in GRID with MVVM

2 Answers 14 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 1
Michele asked on 30 Jan 2014, 10:20 AM
Hi, 
   I've a RadGridView binding :  ItemsSource="{Binding Entities1, Mode=TwoWay}".
  The MVVM works fine, because the items will be show correctly.
  On the MVVM class, I've the dispatcher timer that change a single value of two property of the entities loaded,
  but the grid doesn't refresh the single cell.

   I need to re-attach the datacontext to view the last value updated, but in this scenario the selected row and the pager will be lost.


Is there other way ?

Thank you !

Best regards.
  

2 Answers, 1 is accepted

Sort by
0
Michele
Top achievements
Rank 1
answered on 03 Feb 2014, 12:55 PM
I've tried with this code:

                        this.grid.ClearValue(RadGridView.ItemsSourceProperty);
                        this.grid.ItemsSource = this.ListOfItem;

but causes the complete reload of the grid.
0
Hristo
Telerik team
answered on 03 Feb 2014, 04:19 PM
Hello Michele,

In order to update the cell when it's content has changed, you will have to implement the interface INotifyPropertyChanged. I'm attaching a sample project demonstrating this approach.

Regards,
Hristo
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Michele
Top achievements
Rank 1
Answers by
Michele
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or