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

Different context menu for column headers

Thread ID:





44523 May 25,2006 01:56 PM UTC May 26,2006 03:19 AM UTC WinForms 1
Tags: GridControl
Nick Gardner
Asked On May 25, 2006 01:56 PM UTC

Hi, I''d like to have a different context menu for the column headers than for the rest of the grid. Is there a way this can be achieved using essential studio? Thanks, Nick

Administrator [Syncfusion]
Replied On May 26, 2006 03:19 AM UTC

Hi Nick, A different context menu for the column headers can be popped up by handling the gridControl1.MouseDown event and there by checking the row index and then showing the context menu. Below is a code snippet. private void gridControl1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if(e.Button == MouseButtons.Right) { int row, col; Point pt = new Point(e.X, e.Y); if(gridControl1.PointToRowCol(pt, out row, out col, -1)) { if(row == 0) contextMenu2.Show(this.gridControl1,new Point(e.X,e.Y)); } } } Regards, Calvin.


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

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