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

Context Menu, Right-Clicked and ListBoxSelectionMode Help

Thread ID:





55542 Jan 31,2007 07:08 PM UTC Feb 2,2007 08:58 PM UTC WinForms 1
Tags: Grouping
James Blibo
Asked On January 31, 2007 07:08 PM UTC

I have a ggc that behaves as a listview thru the settings below...

this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.None;
this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiSimple; // One;
this.gridGroupingControl1.TableOptions.ListBoxSelectionCurrentCellOptions = GridListBoxSelectionCurrentCellOptions.HideCurrentCell;

...I want to click on a row and select that row and click on the same row to unselect it. Everything works fine. I want to click anywhere in the ggc and bring up a context menu to operate on the SelectedRecords. ... so I filter out the mouse click with the settings below...

this.gridGroupingControl1.TableModel.Options.SelectCellsMouseButtonsMask = MouseButtons.Left;

However, the context menu is behaving sporadically. It would only come up when the right click occurs on a selected row. Secondly, it would not come up when I right click the same row twice.

Please help!

Administrator [Syncfusion]
Replied On February 2, 2007 08:58 PM UTC

Hi James,

Thanks for being patience.

This can be achieved by handling the TableControlMouseDown event and accordingly showing the context menu popup on the respective co-ordinates.

In the following code snippet, the TableControlMouseDown event is handled and context menu is shown only for the RecordFieldCell
private void gridGroupingControl1_TableControlMouseDown(object sender, GridTableControlMouseEventArgs e)
GridTableCellStyleInfo styleinfo = e.TableControl.PointToTableCellStyle(new Point(e.Inner.X, e.Inner.Y));
if(e.Inner.Button == MouseButtons.Right && styleinfo.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell)
// show contextmenu1
this.contextMenu1.Show(this.gridGroupingControl1, this.gridGroupingControl1.PointToClient(Control.MousePosition));


Kindly let us know if you need any further assistance.
Have a nice day.

Best regards,


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