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

DataTable Calculated Column not updating

1 Answer 179 Views
GridView
This is a migrated thread and some comments may be shown as answers.
svs
Top achievements
Rank 1
svs asked on 18 Apr 2013, 02:27 PM
Hi -

I have a RadGridView bound to a DataTable. Some columns in the table are calculated (via the Expression in the DataColumn).
E.g. I have 3 columns called Position, Demand, and Generation. Position is setup like this (where table is the DataTable):

DataColumn dc = table.Columns["Position"];
dc.Expression = "-Demand+Generation";

(Actually it gets more complicated - there are up to 250+ columns about which I be submitting another question!)

The problem I have here is that when I change either the Demand or Generation column the Grid isn't picking up on the change to the Position column. If I switch to another window in the app and then back, or scroll so that the Position column isn't visible (there are a lot of columns!) then the new calculated figure is shown correctly.

Is there any way I can force the refresh of this calculated column without having to get the users to do this?

Thanks -

1 Answer, 1 is accepted

Sort by
0
svs
Top achievements
Rank 1
answered on 18 Apr 2013, 02:35 PM
Apologies! I did a bit more searching and found this:
http://www.telerik.com/community/forums/wpf/gridview/bind-telerik-grid-view-to-datatable.aspx


Binding to the DataView solved it.

Many Thanks :) !
Tags
GridView
Asked by
svs
Top achievements
Rank 1
Answers by
svs
Top achievements
Rank 1
Share this question
or