Catch Doubleclick in a Win Datagrid cell...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi

I want to catch the event DoubleClick or Keypress from a windows datagrid cell
Is this possible
I only find datagrid events, they dont work in cells..

Thanks for your hel
Bernardo
 
Bernardo,

You should catch the double click event, like you would normally.
However, you will want to get the position of the mouse (which you can get
using the static Position property on the Cursor class, and then calling the
PointToClient method on the DataGrid to get the local coordinates of the
current mouse position). Once you have that, pass the point to the HitTest
method. The return value (DataGrid.HitTestType) will tell you if a cell was
clicked on, and what row and column it was.

With all of that information, you should be able to get the cell and
perform your processing.

Hope this helps.
 
Back
Top