I'm currently trying to bind the "delete" key to an Action when deleting a datagrid row.
Setting a KeyBinding doesn't seem to work:
<DataGrid.InputBindings>
<KeyBinding Key="Delete"
cal:Message.Attach="[Key Delete] = [Action DeletePartNumberRow()]"/>
</DataGrid.InputBindings>
Setting it to the DataGrid, doesn't work either:
<DataGrid x:Name="PartNumbers"
CanUserAddRows="True"
CanUserDeleteRows="True"
cal:Message.Attach="[Gesture Delete] = [Action DeletePartNumberRow()]">
...
</DataGrid>
I was wondering if there is another way of accomplishing this, or if I'm attempting this the wrong way?
Ultimately I would like to be able to create custom key bindings in the application. Is there another way that I could accomplish this?