Hi Tom,
Try the code below in the TableControlMouseDown event to conditionally display a context menu for the grid and not for cells.
private void gridGroupingControl1_TableControlMouseDown(object sender, GridTableControlMouseEventArgs e)
{
GridTableCellStyleInfo styleinfo = e.TableControl.PointToTableCellStyle(new Point(e.Inner.X, e.Inner.Y));
if(e.Inner.Button == MouseButtons.Right && styleinfo.TableCellIdentity.TableCellType == GridTableCellType.EmptyCell)
{
// show contextmenu1
this.contextMenu1.Show(this.gridGroupingControl1, this.gridGroupingControl1.PointToClient(Control.MousePosition));
}
}
private void gridGroupingControl1_TableControlCellClick(object sender, GridTableControlCellClickEventArgs e)
{
if(e.Inner.MouseEventArgs.Button == MouseButtons.Right)
{
// show contextmenu2
this.contextMenu2.Show(this.gridGroupingControl1, this.gridGroupingControl1.PointToClient(Control.MousePosition));
}
}
Let me kmow if this helps.
Regards,
Rajagopal