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.

context menu

Thread ID:

Created:

Updated:

Platform:

Replies:

29642 May 31,2005 04:30 AM May 31,2005 04:45 AM Windows Forms 2
loading
Tags: GridControl
Catinat Velmourougan
Asked On May 31, 2005 04:30 AM

hi I want the context menu to appear only when I right click on the row header and not on the col header or inside any cell.How to do it? regards, catinat

Catinat Velmourougan
Replied On May 31, 2005 04:41 AM

hi I dont know why people who post later than me get replies faster? Clay can you look into my queries also? regards, catinat

Administrator [Syncfusion]
Replied On May 31, 2005 04:45 AM

What grid are you using? Here is code for a GridDataBoundGrid. The code for a GridControl would be similar.
private void gridDataBoundGrid1_MouseUp(object sender, MouseEventArgs e)
{
	Point pt = new Point(e.X, e.Y);
	int row, col;
	if(e.Button == MouseButtons.Right
		&& this.gridDataBoundGrid1.PointToRowCol(pt, out row, out col)
		&& col <= this.gridDataBoundGrid1.Model.Cols.HeaderCount
		&& row > 0)
	{
		this.contextMenu1.Show(this.gridDataBoundGrid1, pt);
	}
}

CONFIRMATION

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.

;