Different context menu for column headers

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

1 Reply

AD Administrator Syncfusion Team 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.

Loader.
Up arrow icon