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.
Syncfusion Feedback

RightClick on the group Caption row

Thread ID:

Created:

Updated:

Platform:

Replies:

55311 Jan 28,2007 07:09 AM UTC Jan 29,2007 02:26 PM UTC Windows Forms 4
loading
Tags: GridControl
Shachar Shimshon
Asked On January 28, 2007 07:09 AM UTC

hi all.
on my form i have a GGC.
i want to catch the event when the user will rightclick on a group Caption row, only on this row!
how can i do it?

Jayakumar Natarajan [Syncfusion]
Replied On January 28, 2007 06:06 PM UTC

Hi Shachar,
Try this code to see if it helps:


private void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
{
if(e.Inner.MouseEventArgs.Button == MouseButtons.Right)
{
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);
if(style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Caption)
{
Console.WriteLine("RightClicked on Caption");
}
}
}


Regards,
Jay

Shachar Shimshon
Replied On January 29, 2007 07:45 AM UTC

thank you for the answer.
now, after i identified the right click, how can i know what's the 'Category' value is?


>Hi Shachar,
Try this code to see if it helps:


private void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
{
if(e.Inner.MouseEventArgs.Button == MouseButtons.Right)
{
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);
if(style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Caption)
{
Console.WriteLine("RightClicked on Caption");
}
}
}


Regards,
Jay

Administrator [Syncfusion]
Replied On January 29, 2007 11:22 AM UTC

Try this code.

GridCaptionRow cap = style.TableCellIdentity.DisplayElement as GridCaptionRow;
string category = cap.ParentGroup.Category.toString();

Shachar Shimshon
Replied On January 29, 2007 02:26 PM UTC

thank you, it's working!

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.

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

;