Silverlight DatePicker in DataGrid: Enter does not submit

Posted by queen3 on Stack Overflow See other posts from Stack Overflow or by queen3
Published on 2010-05-06T12:55:04Z Indexed on 2010/05/06 12:58 UTC
Read the original article Hit count: 968

I have DataGrid with DataGridTemplateColumn which has DatePicker as editing element:

    <data:DataGridTemplateColumn Header="Due date" CanUserSort="False" >
         <data:DataGridTemplateColumn.CellTemplate>
             <DataTemplate>
                <TextBlock Text="{Binding EndDateFormatted}" />
             </DataTemplate>
         </data:DataGridTemplateColumn.CellTemplate>
         <data:DataGridTemplateColumn.CellEditingTemplate>
             <DataTemplate>
                 <controls:DatePicker SelectedDate="{Binding EndDate, Mode=TwoWay}" />
             </DataTemplate>
         </data:DataGridTemplateColumn.CellEditingTemplate>
    </data:DataGridTemplateColumn>

The problem is that Enter key does not work at all when in textbox editing mode - just does nothing. Selecting date from dropdown panel works. Also, Tab does not keep value (reset to previous one), but with help of this I can fix it. But I don't know how to make Enter to accept value and preferably move to next cell.

I also tried third-party date picker, no changes - same issues with Tab and Enter. Seems like a DataGrid issue.

I use Silverlight 3.

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about silverlight-3.0