DataTable Calculated Column not updating

2 posts, 0 answers
  1. svs
    svs avatar
    5 posts
    Member since:
    Sep 2007

    Posted 18 Apr 2013 Link to this post

    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 -
  2. svs
    svs avatar
    5 posts
    Member since:
    Sep 2007

    Posted 18 Apr 2013 Link to this post

    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 :) !
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top