context menu

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

2 Replies

CV Catinat Velmourougan May 31, 2005 08:41 AM UTC

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


AD Administrator Syncfusion Team May 31, 2005 08:45 AM UTC

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);
	}
}

Loader.
Up arrow icon