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
Hi Annie,
I'm not sure what you are trying to do here, but the Mouse isn't actually moving so the coordinates are always going to be the same. The mouse hasn't move, it's the row that has moved under the mouse. I don't know of any way around this - the grid has to scroll the row into view.
Perhaps what you should do is, instead of storing the mouse coords (which you don't really need to store, since they do not change), you could get the row in the MouseDown event and store it in an UltraGridRow variable.
The code I have must be within the Click event. I tried using the Control.MousePosition method and it gives me back the same coordinates as the one I saved within the MouseDown event which is not good because the row at this point already moved to be all visible.
Annie
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.