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.

ContextMenu Not Clearing on Grouping Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

62581 Jun 18,2007 06:22 PM Jun 19,2007 11:32 AM Windows Forms 4
loading
Tags: Grouping
Linda Anderson
Asked On June 18, 2007 06:22 PM

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 06:25 PM

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 07:21 PM

Hi LdfAndy,

Below is a forum thread that discuss with similar task.
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=55808

Best regards,
Haneef

Linda Anderson
Replied On June 19, 2007 11:00 AM

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 11:32 AM

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.




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.

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.

;