Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
165
Get summary values from WinGrid
posted

I have a WinGrid with two bands.  The second band contains summary rows in each group (just simple SUM rows).  I need to check that the SUM value does not exceed 100.

I cannot find anything in the documentation or forums to show how to access the value calculated in the summary row before a user saves the data.  I saw something about casting the summary row to an UltraGridGroupRow - but this throws an exception ("Unable to cast..."). 

UltraGridGroupByRow gbr = (UltraGridGroupByRow)row;

object s = gbr.Rows.SummaryValues["Sum"].Value;

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    This is the correct way to do it. If you are getting an exception when casting to a GroupByRow, then the row must not be a GroupbyRow. So either you are not grouping, or you are usng the wrong row. Or maybe you are trying to access the row before the grid has been grouped. Check the row.IsGroupByRow property to see if the row is a GroupByRow or not. 

Children