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.
Unfortunately, activation email could not send to your email. Please try again.

why do i get my CurrentElement =null is ggc

Thread ID:

Created:

Updated:

Platform:

Replies:

56402 Feb 14,2007 10:12 AM Feb 14,2007 02:12 PM Windows Forms 1
loading
Tags: GridControl
Shachar Shimshon
Asked On February 14, 2007 10:12 AM

hi all.
in the ggc_TableControlCellClick if the user clicked on the GroupCaptionCell, i try to get the 'Category' Value like this:
e.TableControl.Table.CurrentElement.ParentGroup.Category.ToString()
BUT - somethimes the CurrentElement is null.
why?

Administrator [Syncfusion]
Replied On February 14, 2007 02:12 PM

Hi Shankar,

You can use the below code snippet to get the group category name in a TableControlCellClick event.

private void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
{
GridTableCellStyleInfo style = e.TableControl.Model[e.Inner.RowIndex,e.Inner.ColIndex] as GridTableCellStyleInfo;
if( style.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell)
{
GridCaptionRow row = style.TableCellIdentity.DisplayElement as GridCaptionRow;
if( row != null && row.ParentGroup != null )
Console.WriteLine( row.ParentGroup.Category );
}
}

Please refer to attached sample for more details.
ModifiedGGCCurrentCaptionColor.zip

Best regards,
Haneef

CONFIRMATION

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.

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.

;