Hello,
I am working on a RadGridView that requires the capability to move rows up and down within the grid, ideally I would like Alt+Up/Down to execute a command that moves the selected row up or down in the grid. What I've done is created a behavior that is attached to the grid and wires up to the KeyDownEvent or PreviewKeyDownEvent. My issue is that when I hit Up or Down neither of the events are fired. I understand that those keys are used for navigation but I want to handle the event when Alt+Up/Down is pressed but I can't seem to get either of the events when focused on the grid no matter what modifier keys I have pressed. Is there any way to get the KeyDownEvent/PreviewKeyDownEvent to fire for the Up/Down buttons on a RadDataGrid?
EDIT: Using the 'preview' event handler directly (rather that AddHandler) appears to work so I'm past my issue. Thanks
Thanks,
Jason
I am working on a RadGridView that requires the capability to move rows up and down within the grid, ideally I would like Alt+Up/Down to execute a command that moves the selected row up or down in the grid. What I've done is created a behavior that is attached to the grid and wires up to the KeyDownEvent or PreviewKeyDownEvent. My issue is that when I hit Up or Down neither of the events are fired. I understand that those keys are used for navigation but I want to handle the event when Alt+Up/Down is pressed but I can't seem to get either of the events when focused on the grid no matter what modifier keys I have pressed. Is there any way to get the KeyDownEvent/PreviewKeyDownEvent to fire for the Up/Down buttons on a RadDataGrid?
AssociatedObject.AddHandler( UIElement.KeyDownEvent, mKeyEventHandler,
true
);
EDIT: Using the 'preview' event handler directly (rather that AddHandler) appears to work so I'm past my issue. Thanks
AssociatedObject.PreviewKeyDown += _HandlePreviewKeyDown;
Thanks,
Jason