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. Image for the cookie policy date
close icon

GDBG Context Menu For Header Only

Hi, I have a GDBG which has a context menu, but I want the Context menu to appear only when the user clicks the header row and not for other rows. Currently i''m using the following event: ------------------------------------------- private void reqgrid_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if(e.Button == MouseButtons.Right) { int rowIndex=0, colIndex=0; Point clickPoint = this.reqgrid.PointToClient(Cursor.Position); Syncfusion.Windows.Forms.Grid.GridRangeInfoList rangeList = null; if(!this.reqgrid.Selections.GetSelectedRanges(out rangeList, true)) { this.reqgrid.PointToRowCol(clickPoint, out rowIndex, out colIndex); this.reqgrid.CurrentCell.Activate(rowIndex, colIndex); } this.GridContextMenu.Show(this.reqgrid, clickPoint); } } ------------------------------------------------ Please Advice. Regards, Osden Pereira CivilSoft.

1 Reply

AD Administrator Syncfusion Team October 8, 2005 07:52 PM UTC

In your above code, only display the context menu if rowIndex turns out to be 0. This should onll display it when the click is over the header.

Loader.
Live Chat Icon For mobile
Up arrow icon