Reputation: 2939
I have a problem with datagrid control in wpf . when I press enter I want to load selected items in a set of controls, but it seems that datagrid.KeyDown is already handled and it goes to the next item.
I tried using keyup but this event fires when the datagrid keydown had been fired and datagrid goes to the next item.
any idea to handle keydown completely ?
Upvotes: 7
Views: 12342
Reputation: 71
You can add a comma-separated list of handlers to an event...
Private Sub dgMyDataGrid_KeyDown(sender As Object, e As KeyEventArgs) Handles dgMyDataGrid.KeyDown, dgSymbols.PreviewKeyDown
' Perform event programming here...
End Sub
This triggers handling of the "preview" event at the same time as the keydown event, so you don't have to write more than one module.
Upvotes: 0