DatePicker Crashes when trying to edit a DataGrid

Apr 25, 2009 at 12:04 PM
Can someone tell my what I am doing wrong.
When I try to edit, it crashes with the following message 

'DatePicker' TargetType does not match type of element 'TextBox'.

My source code.

  <toolkit:DataGridTextColumn Header="Dato" CanUserSort="False">
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Text" Value="{Binding Path=Dato, StringFormat=m}"/> 
                                <Setter Property="Margin" Value="5,0"/>
                            <Style TargetType="{x:Type toolkit:DatePicker}">
                                <Setter Property="SelectedDate" Value="{Binding Path=Dato, Mode=TwoWay}"/>
                                <Setter Property="Margin" Value="5,0"/>

Apr 26, 2009 at 11:50 PM
You cannot use the default DataGridTextColumn as a placeholder for a DatePicker.  Try the DataGridTemplateColumn instead.