how to grab the values in the aggregated values from the group caption rows ?



in GGC, how to programatically grab the values in the aggregated values from the group caption rows ?

david

3 Replies

RC Rajadurai C Syncfusion Team July 24, 2009 03:17 PM UTC

Hi David,

Thanks for your interest in Syncfusion Products.

From the update, it seems you are displaying summary in group caption. If it is, the aggregated value can be accessed from the caption summary through the GetSummaryText method of GridEngine. Here is the code for your reference handled in QueryCellStyleInfo event which retrieves the summary text from caption summary row.

if (e.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionSummaryCell)
{
Group g = e.TableCellIdentity.DisplayElement.ParentGroup;
if (g != null)
Console.WriteLine(GridEngine.GetSummaryText(g, scd));
}


Regards,
Rajadurai


DC David Cui July 27, 2009 02:25 PM UTC


Thanks, Rajadurai,

Another Question: is there possible or easier way to export all of the summary values into a DataTable ? In another word, I don't need the record fields (details), ONLY need the summary values like a collapsed view (like export data to PDF/CSV for only viewable columns/rows) .

The purpose is to i want to get such values in DataTable format in order to fit to other reports.


best,

David


RC Rajadurai C Syncfusion Team July 28, 2009 02:03 PM UTC

Hi David,

Thanks for your update.

In gridgroupingcontrol, you can export the summary view(collapsed view) to excel sheet using GroupingGridExcelConverterControl or save it to XML file and restore it back in grid using the following code.

this.gridGroupingControl1.Engine.InitializeFrom(GridEngine.CreateFromXml(xr));//xr is XmlReader object
this.gridGroupingControl1.WriteXmlSchema(xw);//xw is XmlTextWriter object

But it is not possible to save it in datatable format.

Please let me know if you have any further queries.

Regards,
Rajadurai

Loader.
Up arrow icon