RightClick on the group Caption row

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?

4 Replies

JN Jayakumar Natarajan Syncfusion Team 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


SS Shachar Shimshon 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


AD Administrator Syncfusion Team January 29, 2007 11:22 AM UTC

Try this code.

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


SS Shachar Shimshon January 29, 2007 02:26 PM UTC

thank you, it's working!

Loader.
Up arrow icon