I am using WPF4 v11.2.
If I have a range highlighted and I press Ctrl S, the range gets deselected. The grid does not appear to do this when other Ctrl key combinations are pressed.
Can you tell me why this is and how to prevent it?
Thanks Stefan. Although your sample does indeed solve the issue. I noticed I was also executing ClearAllSelected in response to other events. I was concerned about blocking that command so instead I overrode OnKeyDown and do not call the base if Control and S are the key args.
Just another note: In my app (and somewhat an industry standard) is that I use the Control S accelerator of File Save in an MDI/XamDockManager app. Not sure if it was the best design choice to have xamDataGrid contending with Control S or other ApplicationCommands key gestures (this would not apply to Copy/Paste, etc).
As always, thanks for your expert help.
Hello,
Thank you for your post. I have been looking into it and I can say that this is the designed behavior of the XamDataGrid. In order to disable this, you can handle CommandExecuting event and check if the Command’s Name is “ClearAllSelected” and if so you can set the e.Handle to true to cancel executing. I attached a sample project with this approach. Please let me know if this helps you or you have further questions on this matter.
Looking forward for your reply.