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
close icon

Get Summary data from Child table

I have mapped a parent child table to my gridgrouping control so that each of my parent record has got a child table in tree view format.

Now, I have a requirement to get the summary row value from my child table and use it in my parent record data calculation.

Can you help me in this..

Many Thanks..




1 Reply

SR Sri Rajan Syncfusion Team September 4, 2008 12:35 PM UTC

Hi Ankit,

Thank you for your interest in Syncfusion products.

You can get the summary row information by using GridEngine.SummaryText(). Please refer to following code that shows you how to get the summary row information.


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);
}


One other way you can do this is by using the below code


int rowIndex = gridGroupingControl1.Table.NestedDisplayElements.IndexOf(summaryRow);
GridTableDescriptor tableDescriptor = null;
foreach (GridSummaryColumnDescriptor scd in summaryRow.SummaryRowDescriptor.SummaryColumns)
{
tableDescriptor = scd.TableDescriptor;
int fieldIndex = tableDescriptor.NameToField(scd.DataMember);
int colIndex = scd.TableDescriptor.FieldToColIndex(fieldIndex);

Console.WriteLine(gridGroupingControl1.TableModel[rowIndex, colIndex].CellValue);
}


Please let me know if this helps.

Best Regards,
Srirajan.


Loader.
Live Chat Icon For mobile
Up arrow icon