I have an Xceed DataGrid, and I’d like for the user to be able to begin edit by either clicking on a currently selected cell (which is the standard behavior), or by pressing the ENTER key on the keyboard while a cell is selected. In the latter case, the currently selected cell should enter edit mode.
I’ve tried setting EditTriggers to BeginEditCommand, but apparently this only works with F2. The documentation says that this is a « default » gesture, but does not explain how to change it.
To change the key used for the BeginEditCommand, you have to modify the InputGestures collection for the command.
DataGridCommands.BeginEdit.InputGestures.Add( new KeyGesture( Key.Enter, ModifierKeys.None ) );
However, keep in mind that the Enter key is already used for the EndEdit command, and adding it to the BeginEdit command will cause changes to the default behavior. One side effect is that the Enter key will no longer work as expected to end the edit, as it is caught by BeginEdit before hand. You will have to make other adjustments, and some behaviors may not be possible without modifications to the source code (which you could do if you have a Blueprint subscription, as it includes the source code).