Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
785
How to get accurate mouse coordinates for partially hidden row
posted

Hi,

In the MouseDown event, I save the mouse X/Y coordinates to reuse them later in the Click event to get the row/cell. My issue is when the user clicks on a row that is partially hidden, it first moves it up a little causing the coordinates to no longer be accurate.

How can I adjust the coordinates if the row is scroll into view?

Thanks.
Annie

P.S. I am using version 9.2.20091.2085

Parents
  • 17259
    Offline posted

    What about using the MouseUp event? You can also get the mouse position in the Click event by using Cursor.Position or Control.MousePosition. Howevenr, this is in screen coordinates and you need to use grid.PointToClient method to convert it.

Reply Children