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

Update Individual Cell

2 Answers 100 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 06 Sep 2010, 09:52 AM

I have a RadGridView that is populated dynamically by a data table. Certain columns are calculated from other columns but the calculations are done by my own calculation engine. When one of the underlying columns is changed I pick up the event and check whether it is part of a calculation. If it is then I do the calculation and need to update the relevant cell/s.

 

My problem comes in when wanting to update the cell/s. Right now I am changing the data table data and then binding the data table back to the grid and calling refresh function.

 

DataTable source = ( DataTable ) this.gridLogsheetGrid.ItemsSource;

 

//Change cell data

 

this.gridLogsheetGrid.ItemsSource = source;

this.gridLogsheetGrid.Items.Refresh ( );

 

This works, however it refreshes the entire grid and is therefore expensive and the grid disappears for a second or two.

 

I have read the thread on applying using the INotifyPropertyChanged event but how will I use this on an individual column on a data table?

2 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 06 Sep 2010, 11:43 AM
Hello Chris,

RadGridView uses INotifyPropertyChanged in the following way. If RadGridView is bound to a list of Person objects, for instance, and those objects implement INotifyPropertyChanged whenever a property of those object is changed the grid will be able to pick up this change and update its UI. 

The DataTable and the DataRow classes do not implement INotifyPropertyChanged and they do not provide change notification. Luckily DataRowView implements INotifyPropertyChanged and if you use DataView instead of DataTable the grid will be able to pick up any changes of the underlying data. 


Kind regards,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Chris
Top achievements
Rank 1
answered on 06 Sep 2010, 02:34 PM
Thanks It works perfectly.
Tags
GridView
Asked by
Chris
Top achievements
Rank 1
Answers by
Milan
Telerik team
Chris
Top achievements
Rank 1
Share this question
or