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