accessing summary row values from another column

Hello,

In the QueryCellStyleInfo event for a particular cell in a summary row (not sure if its called a summary row, I''m talking about the row that gets created when you drag a column heading into the groupDropArea), how do I access a data value in another cell in that summary row.

So if we have 2 columns (X and Y), and I''m in X''s QueryCellStyleInfo event for the summary row cell, how do I access the data value in Y''s summary row cell?

Thanks for all the help over the past few months!

Eric

3 Replies

AD Administrator Syncfusion Team September 15, 2006 06:14 AM UTC

Hi Eric,

You can use the GetSummaries method to get the summary value at the specified index. Below is a code snippet.

switch (e.TableCellIdentity.TableCellType)
{
case GridTableCellType.SummaryFieldCell:
{
GridTable table = e.TableCellIdentity.Table;
GridSummaryRow row = e.TableCellIdentity.DisplayElement as GridSummaryRow;
GridSummaryRowDescriptor summaryRowDescriptor = row.SummaryRowDescriptor;
GridSummaryColumnDescriptor sumCol1 = summaryRowDescriptor.SummaryColumns["ColumnName"]; // name of summary column here ...
if (sumCol1 != null )
{
SummaryDescriptor sd1 = sumCol1.SummaryDescriptor;
if (sd1 != null)
{
int indexOfSd1 = table.TableDescriptor.Summaries.IndexOf(sd1);
CountSummary summary1 = (CountSummary) row.ParentGroup.GetSummaries(table)[indexOfSd1];
Console.WriteLine( "Summary value :" + summary1.Count + ":::" );
}
}
break;
}
}

Thanks for using Syncfusion Products.

Best Regards,
Haneef


EW Eric Weber September 21, 2006 09:59 PM UTC

I have a GroupCaptionSummaryCell, therefore your line of code...

GridSummaryRow row = e.TableCellIdentity.DisplayElement as GridSummaryRow;

threw an error.

Thanks,

eric


EW Eric Weber September 21, 2006 10:26 PM UTC

Nevermind......

this worked...

http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=24926

thanks!

Loader.
Up arrow icon