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

Excel like selection

Thread ID:





104211 Jun 29,2012 09:39 AM UTC Jan 22,2015 04:58 PM UTC WinForms 5
Tags: GridControl
Asked On June 29, 2012 09:39 AM UTC

I am trying to achieve something how it is possible in excel,

On right clicking outside the selected cells, excel un-select the previous selected cell, select the current row and shows the pop up menu but in syncfusion Gridgroupingcontrol doesn't clear the previous selection when I right clicking outside the selected cells.

Can you please suggest how to do the same using Gridgroupingcontrol?

Ragamathulla B [Syncfusion]
Replied On July 2, 2012 04:16 AM UTC

Hi Navaneethan,
Thank you for your interest in syncfusion products.
You can set the SelectCellsMouseButtonsMask to left button to prevent selections changing by right click.. Please refer to the following code which explains the same.
this.gridGroupingControl1.TableModel.Options.SelectCellsMouseButtonsMask = MouseButtons.Left;
Let me know if you have any further concerns.
Ragamathullah B.

Replied On July 2, 2012 04:57 AM UTC

Hi Ragamathullah,

Thanks for your reply,

When I set the mask as left like below code,I have faced nother issue,whenever I right click on the cell directly without any selection of cells in the grid,It  should be selected the last right clicked cell but it doestn't select the active cell in grid grouping control.
this.gridGroupingControl1.TableModel.Options.SelectCellsMouseButtonsMask = MouseButtons.Left;

Issue: When I right click outside the selected cells, Grid control doesn't clear previous selections.

Expected Behavior: When I right click outside the selected cells, Grid control should be clear previous selections and select the current cell as active cell.

Can you please suggest how to do the same using Gridgroupingcontrol?



Ragamathulla B [Syncfusion]
Replied On July 3, 2012 07:17 AM UTC

Mendel Monteiro-Beckerman
Replied On January 20, 2015 02:56 PM UTC

It would be great to get this functionality working in the GridControl and the GridGroupingControl.

From the fact that currently the GridControl Excel-like demo does not display this behaviour and the lack of clarification below I assume it is not currently possible.

Neelakandan Kannan [Syncfusion]
Replied On January 22, 2015 04:58 PM UTC

Hi Mendel,


Thank you for your update.


If you want to clear the selections on MouseRight Click in GridGroupingControl, you can clear the selection by handing TableControlMouseDown event. For this, you need to disable the AllowSelection property to None and ListBxSelectionMode as MultiExtended. Please make use of below code and attached sample,


Code Snippet:

this.gridGroupingControl1.TableOptions.AllowSelection = Syncfusion.Windows.Forms.Grid.GridSelectionFlags.None;

            this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended;

            this.gridGroupingControl1.TableModel.Options.SelectCellsMouseButtonsMask = System.Windows.Forms.MouseButtons.Left;

            this.gridGroupingControl1.TableControlMouseDown += new GridTableControlMouseEventHandler(gridGroupingControl1_TableControlMouseDown);

void gridGroupingControl1_TableControlMouseDown(object sender, GridTableControlMouseEventArgs e)


            if (e.Inner.Button == System.Windows.Forms.MouseButtons.Right)


                if (this.gridGroupingControl1.Table.SelectedRecords != null)


                    foreach (SelectedRecord rec in this.gridGroupingControl1.Table.SelectedRecords)








Please let me know if you have any concerns.




Attachment: Sample_Clearing_Selection_d6a44673.zip


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

or the page will be automatically redirected to 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