How to add ContextMenuStrip to the grid in WinForms GridControl?
Add ContextMenuStrip to the grid
In order to show the ContextMenu in grid cells on right click, the ContextMenuStrip property of grid can be used and the ToolStripMenu items can be added to Items collection of ContextMenuStrip.
Initializing ContextMenu
ContextMenuStrip contextMenuStrip1 = new ContextMenuStrip();
// copyToolStripMenuItem1
ToolStripMenuItem copyToolStripMenuItem1 = new ToolStripMenuItem();
this.copyToolStripMenuItem1.Name = "copyToolStripMenuItem1";
this.copyToolStripMenuItem1.Size = new System.Drawing.Size(175, 24);
this.copyToolStripMenuItem1.Text = "Copy";
//Adding toolstrip menu items to context menu
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.copyToolStripMenuItem1,
this.editToolStripMenuItem,
this.findToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(176, 104);Private contextMenuStrip1 As New ContextMenuStrip()
'copyToolStripMenuItem1
Dim copyToolStripMenuItem1 As New ToolStripMenuItem()
Me.copyToolStripMenuItem1.Name = "copyToolStripMenuItem1"
Me.copyToolStripMenuItem1.Size = New System.Drawing.Size(175, 24)
Me.copyToolStripMenuItem1.Text = "Copy"
'Adding toolstrip menu items to context menu
Me.contextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() { Me.copyToolStripMenuItem1, Me.editToolStripMenuItem, Me.findToolStripMenuItem})
Me.contextMenuStrip1.Name = "contextMenuStrip1"
Me.contextMenuStrip1.Size = New System.Drawing.Size(176, 104)Adding ContextMenu to grid
//Add the context menu to the grid
this.gridControl1.ContextMenuStrip = contextMenuStrip1;
//Event triggering
this.copyToolStripMenuItem1.Click += new System.EventHandler(this.copyToolStripMenuItem1_Click);
//Event Customization
private void copyToolStripMenuItem1_Click(object sender, EventArgs e)
{
//Code to perform actions on context menu item click
GridCurrentCell currentCell = this.gridControl1.CurrentCell;
Clipboard.SetText(this.gridControl1[currentCell.RowIndex, currentCell.ColIndex].CellValue.ToString());
}'Add the context menu to the grid
Me.gridControl1.ContextMenuStrip = contextMenuStrip1
'Event triggering
AddHandler Me.copyToolStripMenuItem1.Click, AddressOf copyToolStripMenuItem1_Click
'Event Customization
private void copyToolStripMenuItem1_Click(Object sender, EventArgs e)
'Code to perform actions on context menu item click
Dim currentCell As GridCurrentCell = Me.gridControl1.CurrentCell
Clipboard.SetText(Me.gridControl1(currentCell.RowIndex, currentCell.ColIndex).CellValue.ToString())The Screenshot below shows the Context MenuStrip in the GridControl

Samples:
Conclusion
I hope you enjoyed learning about how to add ContextMenuStrip to the grid in WinForms GridControl.
You can refer to our WinForms GridControl feature tour page to know about its other groundbreaking feature representations and WinForms GridControl documentation, and how to quickly get started for configuration specifications.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!