We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Accessing raw summary value.

By trial and error I'm getting the raw summary values for the grouped columns, but I cannot access the Grand Total summary this way.

in QueryCellStyleInfo

ITreeTableSummary summary = e.TableCellIdentity.DisplayElement.ParentGroup.GetSummary(e.TableCellIdentity.SummaryColumn.GetSummaryIndex())

What's the best way to access raw summary data for a group and the total summary for the entire table. (Multiple grouping are possible, hence multiple summary levels)

Thanks.

1 Reply

JJ Jisha Joy Syncfusion Team September 1, 2009 10:11 AM UTC

Hi Vasili,

Thank you for your interest in Syncfusion products.

You can try the following code snippet to retrieve all the summary values in the grid. It loops through the Table.NestedElements collection to get the GridSummaryRows and further it loops through SummaryRowDescriptor.SummaryColumns collection of each summary row to get the summary.

foreach (Element el in gridGroupingControl1.Table.NestedElements)
{
GridSummaryRow sr = el as GridSummaryRow;
if (sr != null)
{
foreach (GridSummaryColumnDescriptor scd in sr.SummaryRowDescriptor.SummaryColumns)
{
string result = GridEngine.GetSummaryText(sr.ParentGroup, scd);
Console.WriteLine("GroupLevel = {0}, SummaryColumns_Name = {1}, Value = {2}", sr.GroupLevel, scd.Name, result);
}
}
}

If you want to retrieve only the visible summary values in the grid you can loop through NestedDisplayElements collection instead of NestedElements.

Please try this and let me know if it helps you.

Regards,
Jisha

Loader.
Live Chat Icon For mobile
Up arrow icon