I would like to detect when a user completes a range selection in a XamDataGrid using the mouse. I can detect individual selection changes but I only want to detect when a user has finished a range selection. For example. A user holds the CTRL key, mouse-down's on a record, drags the highlight across multiple records, and releases the mouse button (the mouse may be on or off the grid at this point). I tried LostMouseCapture, but the event gets triggered when the mouse leaves the grid but the button is still down.
Thanks.
Hello,
Have you tried the PreviewMouseLeftButtonUp event (either for the Window or the XamDataGrid itself)? It will fire even if you release the button outside the client area of the application window. There you can check for sender, OriginalSource, etc. to determine whether you have to consider this dragging/selection of records or not. You can also use this in combination with the PreviewMouseLeftButtonDown event.
Hi Alex,
That's what I'm looking for :).
Thank you sir!