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. Image for the cookie policy date

GridGroupingControl how to get a context menu with Cut/Copy/Paste for the activated cell

For a GridGroupingControl, I would like to be able to show a context menu(with Cut, Copy, Paste) if the active cell is a TextBox when the user performs a right click. 

How can I achieve this?

Thanks for your help!

3 Replies

SA Solai A L Syncfusion Team July 13, 2015 05:50 AM UTC

Hi Taylour,

Thank you for your interest in Syncfusion products.

In order to add a context menu, you can it in cell edit mode while the TableControlGotFocus. Please refer the below UG link for reference.

UG Link :

Please refer the below KB and installed location sample to add copy paste option in context menu.

KB Link :

Sample Link :
<Installed Location>\Syncfusion\EssentialStudio\<Version?\Windows\Grid.Grouping.Windows\Samples\Layout Customization\Cut-Copy-Paste Demo\cs

Please let us know if you have any other concerns.

Thanks & Regards,

TT tttmack July 13, 2015 10:50 PM UTC

thanks but that method did not work in my case.

I was able to get things working with the following code:

private ContextMenuStrip _contextMenuStrip;

public Form1()
            _contextMenuStrip = new ContextMenuStrip();
            _contextMenuStrip.Items.Add("Cut", Properties.Resources.Cut, GridCutContextMenu);
            _contextMenuStrip.Items.Add("Copy", Properties.Resources.Copy, GridCopyContextMenu);
            _contextMenuStrip.Items.Add("Paste", Properties.Resources.Paste, GridPasteContextMenu);

            var textRenderer = gridGroupingControl1.TableControl.CellRenderers["TextBox"] as GridTextBoxCellRenderer;
            textRenderer.TextBox.MouseUp += GridGroupingControlTextBox_MouseUp;

void GridGroupingControlTextBox_MouseUp(object sender, MouseEventArgs e)
            if(e.Button == MouseButtons.Right)

private void GridCutContextMenu(object sender, EventArgs e)

private void GridCopyContextMenu(object sender, EventArgs e)

private void GridPasteContextMenu(object sender, EventArgs e)

SA Solai A L Syncfusion Team July 14, 2015 11:13 AM UTC

Hi Taylour,

Thank you for your update.

We are glad to know that your issue has been resolved. Please let us know if you have any other further concerns in future.

Thanks & Regards,

Live Chat Icon For mobile
Up arrow icon