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

GDBG Context Menu For Header Only

Thread ID:





35760 Oct 8,2005 01:07 PM UTC Oct 8,2005 07:52 PM UTC WinForms 1
Tags: GridControl
Osden Pereira
Asked On October 8, 2005 01:07 PM UTC

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 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.


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