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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top