DatePicker does not raise the KeyDown

Oct 15, 2009 at 2:44 PM

Hi,

DatePicker control does not raise the KeyDown event when you press the enter key.

The code below don't print anything.

<StackPanel x:Name="stackPanel"
            KeyDown="stackPanel_KeyDown">
    <toolkit:DatePicker Margin="5"
                        x:Name="datePicker"
                        KeyDown="datePicker_KeyDown" />
</StackPanel>
private void stackPanel_KeyDown(object sender, KeyEventArgs e)
{
    Console.WriteLine("Control: stackPanel - Key: {0}", e.Key);
}

private void datePicker_KeyDown(object sender, KeyEventArgs e)
{
    Console.WriteLine("Control: datePicker - Key: {0}", e.Key);
}

Oct 24, 2009 at 4:42 PM

I had a similar problem when trying to move the focus to another control after the Enter key was pressed.

I described the solution in this thread:

http://wpf.codeplex.com/Thread/View.aspx?ThreadId=72970