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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

attempt to right-click on a column header to display a context menu sorts the ggc instead

Thread ID:

Created:

Updated:

Platform:

Replies:

55153 Jan 24,2007 02:56 PM UTC Jan 25,2007 09:33 AM UTC WinForms 1
loading
Tags: Grouping
James Blibo
Asked On January 24, 2007 02:56 PM UTC

I would like to right click on the ggc column header to display a context menu to execute a command. However, right-clicking on the column header sorts the column instead. How can I make only left-click sorts the ggc and right click display a context menu.

Administrator [Syncfusion]
Replied On January 25, 2007 09:33 AM UTC

Hi James,

Thank you for being patience.

Please try using the following code snippet to achieve the intend behavior. This can be achieved by handling the TableControlCellMouseDown event. In the event, the context menu is shown on right click.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//this.gridGroupingControl1.TableControlCellMouseDown += new GridTableControlCellMouseEventHandler(gridGroupingControl1_TableControlCellMouseDown);
void gridGroupingControl1_TableControlCellMouseDown(object sender, GridTableControlCellMouseEventArgs e)
{
GridTableCellStyleInfo style = e.TableControl.Table.TableModel[e.Inner.RowIndex, e.Inner.ColIndex];
if (style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell)
{
if (e.Inner.MouseEventArgs.Button == MouseButtons.Right)
{ menu.Show(this.gridGroupingControl1, e.Inner.MouseEventArgs.Location);
e.Inner.Cancel = true;
}
}
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

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

Best regards,
Madhan

CONFIRMATION

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.

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

;