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.

GDBG Context Menu For Header Only

Thread ID:





35760 Oct 8,2005 09:07 AM Oct 8,2005 03:52 PM Windows Forms 1
Tags: GridControl
Osden Pereira
Asked On October 8, 2005 09:07 AM

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.

Administrator [Syncfusion]
Replied On October 8, 2005 03:52 PM

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.


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.

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.