Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wpf : how to handle KeyDown Event for Datagrid?

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 ?

like image 594
Pouyan Avatar asked Jul 25 '11 17:07

Pouyan


1 Answers

Use the PreviewKeyDown event instead of KeyDown

like image 168
Rachel Avatar answered Sep 22 '22 09:09

Rachel