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

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

Thread ID:





119591 Jul 11,2015 12:33 AM UTC Jul 14,2015 11:13 AM UTC WinForms 3
Tags: GridGroupingControl
Asked On July 11, 2015 12:33 AM UTC

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!

Solai A L [Syncfusion]
Replied On 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,

Replied On 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)

Solai A L [Syncfusion]
Replied On 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,


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

or the page will be automatically redirected to 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