Hi Prabhjeet,
Thank you for posting query to us.
This can be achieved by handling the TableControl.MouseUp event of GridGroupingControl. Please refer the code:
this.gridGroupingControl1.TableControl.MouseUp += new MouseEventHandler(TableControl_MouseUp);
void TableControl_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
GridTableControl tableControl = sender as GridTableControl;
GridTableCellStyleInfo style = (GridTableCellStyleInfo)tableControl.PointToTableCellStyle(new Point(e.X, e.Y));
Point pt = tableControl.PointToClient(Control.MousePosition);
if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.ColumnHeader)
{
this.contextMenuStrip1.Show(tableControl, pt);
}
else if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Caption)
{
this.contextMenuStrip2.Show(tableControl, pt);
}
else if (style.TableCellIdentity.ColIndex == 0)
{
this.contextMenuStrip3.Show(tableControl, pt);
}
else if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record)
{
this.contextMenuStrip4.Show(tableControl, pt);
}
}
}
Please refer the sample in the link to illustrate this:
http://websamples.syncfusion.com/samples/Grid.Windows/37401/main.htmKindly try this and let me know if you need further assistance.
Regards,
Jisha