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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How do I get the column name when on a summary row or caption row?

Thread ID:





49413 Sep 18,2006 07:37 PM UTC Sep 19,2006 05:24 AM UTC WinForms 1
Tags: Grouping
Asked On September 18, 2006 07:37 PM UTC

ow do I get the column name when on a summary row or caption row?

How do I get the column name of the current cell when the current cell is a summary row of a child table?

Administrator [Syncfusion]
Replied On September 19, 2006 05:24 AM UTC

Hi James,

You can use code like:

GridCurrentCell cc = e.TableControl.CurrentCell;
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(cc.RowIndex, cc.ColIndex);

switch(style.TableCellIdentity.DisplayElement.Kind )
case DisplayElementKind.Summary:
GridSummaryRow row = style.TableCellIdentity.DisplayElement as GridSummaryRow;
if( style.TableCellIdentity.SummaryColumn != null)
else /* Empty SummaryColumn*/
int index = row.ParentTableDescriptor.ColIndexToField(cc.ColIndex);
Console.WriteLine(row.ParentTableDescriptor.Columns[index].Name );
case DisplayElementKind.Caption:
GridCaptionRow row1 = style.TableCellIdentity.DisplayElement as GridCaptionRow;
int index1 = row1.ParentTableDescriptor.ColIndexToField(cc.ColIndex);
Console.WriteLine(row1.ParentTableDescriptor.Columns[index1].Name );

to get the information you wanted.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon