{Using latest version}
Trying to get around a problem that I posted here:
http://community.infragistics.com/forums/p/52238/272066.aspx#272066
I want to access the summary rows in the grid so I can manually set a summary value. So I attached the following method. However, if I put a breakpoint inside the if statement the it is never activated - it does hit with the breakpoint on the "if" statement.
As you can see from the attached image, I clearly have summaries defined.
Any other way of doing this? Basically, because of the above referenced bug (?) I need to figure out a way to manully insert a value for "Summary = " which is the difference of DRSum - CRSum
private void ultraGrid2_InitializeRow(object sender, InitializeRowEventArgs e) { if (e.Row.IsSummaryRow) { double d1 = 0.0; double d2 = 0.0; double d3 = 0.0; d1 = (double)e.Row.GetCellValue("DR"); d2 = (double)e.Row.GetCellValue("CR"); d3 = d1 - d2; } }
Same behaviour with ultraGrid2_InitializeGroupByRow method
Thanks
InitializeRow doesn't fire for summary rows. You can assume control of the summary calculations by implementing the ICustomSummaryCalculator interface on a class, then passing an instance of that class to the SummariesCollection.Add method (one of the overloads has a parameter for this).
Hi Brian,
OK, then that's what I was confused about - the fact that IsSummaryRow even exists for the event arguments (InitializeRowEventArgs) if it's never even called for summary rows.
But I'm still confused because as I'm writing this I did a quick search here to see where/how IsSummaryRow is used and found this post:
http://community.infragistics.com/forums/p/49599/262506.aspx#262506
where Mike Saltzman suggests to use this tidbit of code:
Hi Sanjeev,
So all you need to do is make your SummaryRow fixed on top of the grid. That's easy.
private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e) { if (IsSummaryRow(e.Row)) e.Row.Fixed = true; }