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 in GGC

Thread ID:

Created:

Updated:

Platform:

Replies:

73278 Apr 28,2008 06:28 PM UTC May 2,2008 06:24 AM UTC WinForms 1
loading
Tags: GridControl
abc
Asked On April 28, 2008 06:28 PM UTC

I am using syncfusion 6.1 GGC and context menu. Now on mouse right click on GGC cell i want context menu to open. This is working fine but i don't want that context menu to open when right click is done on GGC header.
I will be v thankful if anyone could help me in this.


Jisha Joy [Syncfusion]
Replied On May 2, 2008 06:24 AM UTC

Hi,

This can be achieved by handling the TableControl.MouseUp event and check for ColumnHeader cells.

Please refer the code:


this.gridGroupingControl1.TableControl.MouseUp += new MouseEventHandler(TableControl_MouseUp);
void TableControl_MouseUp(object sender, MouseEventArgs e)
{

if (e.Button == MouseButtons.Right)
{
GridTableControl tableControl = sender as GridTableControl;
GridTableCellStyleInfo style = (GridTableCellStyleInfo)tableControl.PointToTableCellStyle(new Point(e.X, e.Y));
Point pt = tableControl.PointToClient(Control.MousePosition);

if (style.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.ColumnHeader)
{
this.contextMenuStrip1.Show(tableControl, pt);


}
}
}

Also Please refer the following forum thread that for more information:

http://www.syncfusion.com/Support/Forums/message.aspx?&MessageID=73262


Regards,
Jisha


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

;