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. Image for the cookie policy date
close icon

ContextMenu Not Clearing on Grouping Grid

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;



4 Replies

LA Linda Anderson 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).


HA haneefm Syncfusion Team June 18, 2007 11:21 PM UTC

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


LA Linda Anderson 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.


LA Linda Anderson 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.




Loader.
Live Chat Icon For mobile
Up arrow icon