I have a DataGridTemplateColumn
. Inside its CellEditingTemplate
, I put a DatePicker
control. Now if I want to edit the date, I have to
You have to override the PrepareCellForEdit
in DataGridTemplateColumn
as follows:
public class DataGridDateColumn:DataGridTemplateColumn
{
protected override object PrepareCellForEdit(FrameworkElement editingElement,
RoutedEventArgs editingEventArgs)
{
editingElement.MoveFocus(new TraversalRequest(FocusNavigationDirection.First));
return base.PrepareCellForEdit(editingElement, editingEventArgs);
}
}
XAML