datagrid ALT +A keydown

Mar 10, 2011 at 9:02 AM

Hi,

I am trying to capture this key event in my datagrid preview key down...but all that i get is a windows system sound. My other key events are ok. Can I use ALT + Keys shortcuts with the WPF datagrid??

Thanks

 

private void dgPa_PreviewKeyDown(object sender, KeyEventArgs e)

{

 

if (e.Key == Key.A && Keyboard.Modifiers == ModifierKeys.Alt)
{  
   
}

}

Mar 10, 2011 at 1:36 PM

Got it.

if (e.KeyboardDevice.Modifiers == ModifierKeys.Alt)
{
   if (e.SystemKey == Key.A)
   {

   }

}