Hi,
I have a ultragrid that has a summary row. I also implemented hide/unhide row functionality as part of requirement. Now here the issue - when i hide the rows on gird it also affecting the summary row at the bottom i.e. .Sum is ignoring the values of hidden row its only calculating what’s visible on grid.
I also tried implementing ICustomSummaryCalculator but there also i'm not getting reference of hidden row!
Is there any setting/property to through i can tell summary field to consider hidden rows for sum?
Thanks
Venkatesh
Are you sure your summary is using a Formula and not just a SummaryType.Sum?
I tested this out and it worked fine for me.
Till still not working... tried both RowIndex and ListIndex.
My code to hide row -- row.Hidden = true;
private
void WebCatalogueDataGrid_InitializeLayout(object sender, InitializeLayoutEventArgs e)
{
UltraGridLayout layout = e.Layout;
UltraGridBand band = layout.Bands[0];
UltraGridOverride ov = layout.Override;
ov.FormulaRowIndexSource =
FormulaRowIndexSource.RowIndex;
}
Note: I've not design my grid at design time instead I just build datatable with dynamic columns and attached it to my grid and do the formatting.
Sorry, I forgot there is one more thing you need to do. By default, formulas use the visible rows in the grid, but you can change this by setting the FormulaRowIndexSource property:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; UltraGridOverride ov = layout.Override; ov.FormulaRowIndexSource = FormulaRowIndexSource.RowIndex; }
In this case, you can use RowIndex or ListIndex. Either one will work - just don't use VisibleIndex.
changes to 7.00*
Hi Mike,
As you suggested I tried the CalcManager and I think it will be used to apply formula between columns calculation! But for my requirement I need to show summary row at the bottom of the grid.
Everything working fine - except when user hide rows on the grid which already having value in their cell are not taken into summary total.
e.g
Item #
Item Desc
Price
1
Abc
2.00
2
Add
3.00
3
Test 2
5.00
Total: 10.00
Now when I hide the Item # 2 row - the total at the bottom changes to 8.00 whereas I expect it to remain 10.00 (becz i'm just hiding the row not removing it from grid - when i unhide the row, total back to 10.00)