We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Attaching a Context menu when the cell is in Edit mode and Non-edit mode.

Thread ID:





117903 Jan 7,2015 07:02 AM Jan 8,2015 08:28 AM Windows Forms 1
Tags: GridGroupingControl
Asked On January 7, 2015 07:02 AM


          How to Attach a Context menu when the cell is in Edit Mode and Non-edit mode?

Ranjan VijayKumar.

Muthukumar Kalyanasundaram [Syncfusion]
Replied On January 8, 2015 08:28 AM

Hi Ranjan,


Thank you for your interest in Syncfusion products.


The GridControl is show the context menu, when the right click has been performed in GridControl. The GridControl does not have default property to show the context menu in editing mode. If you want the context menu also in the editing mode, then please try using GridTextBoxRenderer class in GridControl to achieve this behavior.




private void Form1_Load(object sender, EventArgs e)
this.gridControl1.ContextMenuStrip = this.contextMenuStrip1;
GridTextBoxCellRenderer tr = this.gridControl1.CellRenderers["TextBox"] as GridTextBoxCellRenderer;
tr.TextBox.MouseUp += new MouseEventHandler(TextBox_MouseUp);

void TextBox_MouseUp(object sender, MouseEventArgs e)
if (e.Button == MouseButtons.Right)
Point pt = GridUtil.CenterPoint(this.gridControl1.CurrentCellRenderer.GetCellClientRectangle(this.gridControl1.CurrentCell.RowIndex, this.gridControl1.CurrentCell.ColIndex, GridStyleInfo.Default, false));
this.contextMenuStrip1.Show(this.gridControl1, pt);


Please let us know if you have any concern.



Muthukumar K

Attachment: ContextMenu_83095f9c.zip


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.