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.
Syncfusion Feedback

contextmenu for editable cells

Thread ID:

Created:

Updated:

Platform:

Replies:

100089 Jul 3,2011 12:06 AM UTC Aug 2,2011 02:37 PM UTC WPF 9
loading
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?

Thanks.


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.

Regards,
Ramesh


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.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GDCSample1258500571.zip

Please let us know if you have any queries.

Thanks,
Deenadhayalan



GDCSample1258500571_ff03acad.zip

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



WPF_GDC_CheckBox_41be6e49.zip

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


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

Sorry,

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





WPF_GDC_CheckBox_66106f95.zip

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.

Regards,
Deenadhayalan




WPF_GDC_CheckBox_acdbcddd.zip

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.

Regards,
Deenadhayalan


CONFIRMATION

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.

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

;