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.

Contextmenu on Header Row

Thread ID:

Created:

Updated:

Platform:

Replies:

17839 Aug 18,2004 02:24 AM Aug 18,2004 03:21 AM Windows Forms 1
loading
Tags: GridControl
Anil Kumar M
Asked On August 18, 2004 02:24 AM

Hi I am having a context menu for my Databounddatagrid, I am enabling contextMenu when user clicks on cells which are not static and readonly. I am doing this in grid_MouseDown event like this if(e.Button == MouseButtons.Right) { if(this.Grid.CurrentCell.ColIndex != 1 && this.Grid.CurrentCell.ColIndex != 2) { Grid.ContextMenu=null; } else { Grid.ContextMenu=this.cmnuContextMnu; } } here Columns ColIndex 1 & 2 cells are non static. the above code works fine when i am clicking on static and nonstatic cells but when i click on Columns Headers cells the ContextMenu still popsup, how do i get the RowIndex in mousedown event. to get the row index(RowIndex = 0 for header row cells), i used cellclick event in which i had placed the above MouseDown event code..but still iam having the problems is there any way i can effectively show the contextmenu only on non static cells. how do desable context menu for header row cells. ---seash

Administrator [Syncfusion]
Replied On August 18, 2004 03:21 AM

You can get the row/column with code like this:
int row, col;
Point pt = new Point(e.X, e.Y);
if(grid.PointToRowCol(pt, out row, out col, -1))
{
    // row and col should point to the cell
}

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.

;