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.
Up arrow icon