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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to show grid ContextMenuStrip while TextBox cell in editing

Thread ID:





117032 Jul 23,2014 09:12 PM UTC Jul 27,2014 12:56 PM UTC WinForms 1
Tags: GridControl
Qingde Shi
Asked On July 23, 2014 09:12 PM UTC


I am using the grid control and have a customized ContextMenuStrip, how can show this menu in TextBox type cell while the cell is in editing mode?



Muthukumar Kalyanasundaram [Syncfusion]
Replied On July 27, 2014 12:56 PM UTC

Hi Qingde,

Thank you for your interest in Syncfusion products.

If you want to show the context menu in GridControl while current cell editing mode, then please try to using the TextBox.MouseDown event in GridTextBoxCellRenderer to achieve this functionality as shown below.


            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 me know if you have any concern.



Muthukumar K


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon