I could not get this to work with XAML at all. But the following C# code seems to work, but should it really be this difficult! I don't know how to code the
Value="{Binding Value}"
though
Value="{Binding Value}"
though
var tp = new List<TargetPropertyType>();
tp.Add(new TargetPropertyType()
{
Type = typeof(Nullable<DateTime>)
});
var et = new DataTemplate()
{
DataType = typeof(Xceed.Wpf.Toolkit.DateTimePicker)
};
et.VisualTree = new FrameworkElementFactory(typeof(Xceed.Wpf.Toolkit.DateTimePicker));
et.VisualTree.SetValue(Xceed.Wpf.Toolkit.DateTimePicker.FormatProperty, Xceed.Wpf.Toolkit.DateTimeFormat.ShortDate);
et.Seal();
this.propertyGridOut.EditorDefinitions.Add(
new EditorTemplateDefinition()
{
TargetProperties = tp,
EditingTemplate = et
});