Hi Jan,
Thank you for your interest in Syncfusion products. You could achieve the desired behavior by handling the MouseDown event. This will allow us to display contextmenu on right clicking on the grid cells by checking the e.Inner.Button property. Sample also shows how to display different context menu on different parts of the grid.
if (e.Inner.Button == System.Windows.Forms.MouseButtons.Right)
{
int row = 0;
int col = 0;
Point pt = new Point(e.Inner.X, e.Inner.Y);
e.TableControl.PointToRowCol(pt, out row, out col);
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(row, col);
if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.ColumnHeader)
{
this.ContextMenuStrip1.Show(e.TableControl, pt);
}
//Caption
else if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Caption)
{
this.ContextMenuStrip2.Show(e.TableControl, pt);
}
//RowHeader
else if (style.TableCellIdentity.ColIndex == 0)
{
this.ContextMenuStrip3.Show(e.TableControl, pt);
}
//Cell
else if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record)
{
this.ContextMenuStrip4.Show(e.TableControl, pt);
}
}
}
Sample for your reference:
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GGCMenu-348734224.zipPlease let me know if this helps.
Regards,
Christo.