i have a grid which i set the AllowUpdate property to False,but when i press F2 the selected cell opens for edit.
how can i avoid that?
I assume that you are not actually able to change the value in the cell... it just goes into edit mode to allow the user to select text, but they should not be able to change anything.
There are a number of ways you could handle this. One way would be to set the CellActivation property on each column in the grid.
Another is to handle the BeforeEnterEditMode event of the grid and set e.Cancel to true.