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

Syncfusion.Grid.Grouping.Windows using want to avoid Right Click for sorting

Hi Syncfusion.Grid.Grouping.Windows using,
i want to give same feature in our grid, but when user do right click column sort.



Right Click on header.zip

3 Replies

HA haneefm Syncfusion Team May 17, 2007 03:37 PM UTC

Hi,

This can be achieved by handling a the TableControlQueryAllowSortColumn event handler and set the e.AllowSort property to false when the MouseButton is right clicked . Here is a code snippet to show this.

this.gridGroupingControl1.TableControlQueryAllowSortColumn +=new GridQueryAllowSortColumnEventHandler(gridGroupingControl1_TableControlQueryAllowSortColumn);
private void gridGroupingControl1_TableControlQueryAllowSortColumn(object sender, GridQueryAllowSortColumnEventArgs e)
{
if( e.CellClickEventArgs.MouseEventArgs.Button == MouseButtons.Right )
e.AllowSort = false;
}

Best regards,
Haneef


AS Ashok May 17, 2007 04:02 PM UTC

Hi CellClick event agrs not defined,
so what we have to declare events or what


>Hi,

This can be achieved by handling a the TableControlQueryAllowSortColumn event handler and set the e.AllowSort property to false when the MouseButton is right clicked . Here is a code snippet to show this.

this.gridGroupingControl1.TableControlQueryAllowSortColumn +=new GridQueryAllowSortColumnEventHandler(gridGroupingControl1_TableControlQueryAllowSortColumn);
private void gridGroupingControl1_TableControlQueryAllowSortColumn(object sender, GridQueryAllowSortColumnEventArgs e)
{
if( e.CellClickEventArgs.MouseEventArgs.Button == MouseButtons.Right )
e.AllowSort = false;
}

Best regards,
Haneef

Right Click on header1.zip


AS Ashok May 17, 2007 04:16 PM UTC

Done Thanks i capture event from other evnet handler, is there any straight forward

>Hi CellClick event agrs not defined,
so what we have to declare events or what


>Hi,

This can be achieved by handling a the TableControlQueryAllowSortColumn event handler and set the e.AllowSort property to false when the MouseButton is right clicked . Here is a code snippet to show this.

this.gridGroupingControl1.TableControlQueryAllowSortColumn +=new GridQueryAllowSortColumnEventHandler(gridGroupingControl1_TableControlQueryAllowSortColumn);
private void gridGroupingControl1_TableControlQueryAllowSortColumn(object sender, GridQueryAllowSortColumnEventArgs e)
{
if( e.CellClickEventArgs.MouseEventArgs.Button == MouseButtons.Right )
e.AllowSort = false;
}

Best regards,
Haneef

Right Click on header1.zip

Loader.
Live Chat Icon For mobile
Up arrow icon