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 Not Clearing on Grouping Grid

Thread ID:





62581 Jun 18,2007 10:22 PM UTC Jun 19,2007 03:32 PM UTC WinForms 4
Tags: Grouping
Linda Anderson
Asked On June 18, 2007 10:22 PM UTC

Syncfusion Version: 4.2

I have a grouping grid filled with rows of information where a 'Status' field may be different from row to row. Based on the value of the Status, I may have no items in a context menu or I may have one or more different items.

I want to use the new record-based selection code so my grid settings are as follows:

I catch the grid mouse click event and if it is a right mouse button, I fall through the code to 1st clear the current context menu, then resetup the context menu based on the status values in the row(s) selected.

This all works fine if I click on the ROW HEADER. But if I click on the Row Header and get a context menu item with A, B, and C menu items. Then I left-click on a cell in a different row; the row appears to be selected just fine; I fall through my code and I can see that the grid's context menu is being cleared but the context menu with A, B, and C still appears.

I found a support note on another grid-vendors site (Infragistics) that addressed a similar problem. They stated that the context menu was assigned to the underlying textbox on the grid so they provided code to clear each cell's context menu.

I see nothing remotely similar in the Syncfusion Grouping Grid but I'm guessing the problem is something like this.

How do I force the grid's cell to realize that a new Context Menu has been assigned to the grid and to use that one instead of the 'old' one?

Once again - all works fine if I click on the Row Header and not in an individual cell.

grpGrid.TableDescriptor.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended;
grpGrid.TableDescriptor.TableOptions.AllowSelection = GridSelectionFlags.None;
grpGrid.TableModel.Options.SelectCellsMouseButtonsMask = MouseButtons.Left;

grpGrid.TableDescriptor.AllowNew = false;
grpGrid.TableDescriptor.AllowEdit = false;
grpGrid.TableDescriptor.AllowRemove = false;

Linda Anderson
Replied On June 18, 2007 10:25 PM UTC

Note - to clarify my previous message. I left-click in a cell on a different row and the row appears selected. Then I right-click to bring up the context menu and it falls through my code ...

(I wanted to clarify that I do a left-click to select the row; then a right-click to show the menu).

haneefm [Syncfusion]
Replied On June 18, 2007 11:21 PM UTC

Hi LdfAndy,

Below is a forum thread that discuss with similar task.

Best regards,

Linda Anderson
Replied On June 19, 2007 03:00 PM UTC

Not exactly the behaviour I was after but I worked around the issue. The users must right-click in the row header in order to get a context menu. Using the options specified in this thread, the behaviour was not consistent.

Linda Anderson
Replied On June 19, 2007 03:32 PM UTC

I finally achieved the behaviour I was after with the following:

Catch grid TableControl Mouse Down.
In that Event, clear the grids context menu. If the button is a right-click, resetup the context menu.

The clearing of the context menu appears to work ok.


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