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

contextmenu for editable cells

Thread ID:





100089 Jul 3,2011 12:06 AM UTC Aug 2,2011 02:37 PM UTC WPF 9
Tags: GridControl
Mary Fontana
Asked On July 3, 2011 12:06 AM UTC

When I create columns that are editable using GridDataVisibleColumn with ReadOnly = false,
the menu that appears for cells in that column is copy,paste,cut.
I would like to add another menuitem.
I tried doing this by setting a GridDataControl.ContextMenu.
But this menu only appears for the read-only cells.

How do I add custom menu items to the default menu for textbox cells that are editable?


Ramesh V [Syncfusion]
Replied On July 11, 2011 11:39 AM UTC

Hi Mary,

Thanks for using Syncfusion products.
By Default we cannot include Items into Default ContextMenu. But we can create our own context menu. We have prepared a sample based on this you can find the sample under the following location.

Sample: http://www.syncfusion.com/uploads/redirect.aspx?file=ContextMenu_Sample-_e4bff4c6.rar&team=testingftp

Please let me know if you need further assistants.


Mary Fontana
Replied On July 22, 2011 01:57 PM UTC

Hi. The link you posted does not exist.

Deenadhayalan M [Syncfusion]
Replied On July 26, 2011 12:34 PM UTC

Hi Mary,

Please find the below link for the sample.


Please let us know if you have any queries.



Mary Fontana
Replied On July 26, 2011 04:54 PM UTC

Your sample does not work for me I think because I use GridDataVisibleColumn to add the columns.

Your example sets gridControl's ContextMenu

dataGridControl.ContextMenu = menu;

I already had the context menu set.

But when you use GridDataVisibleColumn that uses a TextBox,
the menu used is not the one in dataGridControl.

Please see my attached sample. I added event to handle PreviewMouseRightButtonDown


Mary Fontana
Replied On July 26, 2011 07:34 PM UTC

Please ignore my previous post. I finally got this working by setting the
ColumnStyle = new GridDataColumnStyle() for each GridDataVisibleColumn.

Thanks for your sample.


Mary Fontana
Replied On July 26, 2011 08:23 PM UTC


It still doesnt work. I will see the new context menu in a textbox, but only if I dont select the text box for editing.
and then it uses the copy/paste/cut menu


Deenadhayalan M [Syncfusion]
Replied On July 29, 2011 03:49 PM UTC

Hi Mary,

Sorry for the inconvenience caused.

We have modified the sample based on your requirement with cut, copy, paste, undo items in the context menu. Please find the attached sample for your reference.

Please let us know if you have any queries.



Mary Fontana
Replied On July 29, 2011 06:38 PM UTC

Hi. Thanks for the update.

I only see the new menu items "cut/copy/paste/undo on the column headers when I right click mouse.
The cells that can be edited still have the copy/cut/paste menu which I think is from the Textbox.
So like if I select Sync1 and then right click I still see the menu copy/cut/paste.

Is there cell type other then textbox that I should use so that the menu is not is not set.

For Now I have implemented a button to do the extra feature on the selected item.

Deenadhayalan M [Syncfusion]
Replied On August 2, 2011 02:37 PM UTC

Hi Mary,

Sorry for the inconvenience caused.

You can achieve your requirement by setting the DisableEditorsContextMenu property to true as follows, This property will disable the editors context menu.

Code snippet [C#]:

this.gdc.Model.DisableEditorsContextMenu = true;

Please let us know if you have any queries.



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