Hello
given is an WPF Application with an PropertyGrid.
I have values as DateTime I have to display time also. I found syncfusion also offer
DateTimePicker with FullDateTime format.
How to cutomize this Control?
thank you
Lech
Thank you for the example. But DateTimeEditor doesn't fit my needs.
I rather would like to use DateTimeEdit what have the Porperty Format.
Too bad that DateTimeEdit not Implement ITypeEditor. So I could do something like this:
editor.Editor = (ITypeEditor) new DateTimeEdit()
{
Pattern = DateTimePattern.FullDateTime
};
Is it possible to fix?
Thank you
Lech
Its works. Like this:
public class DateTimeEditEx : DateTimeEdit, ITypeEditor
{
#region Implementation of ITypeEditor
/// <inheritdoc />
public void Attach(PropertyViewItem property, PropertyItem info)
{
//throw new NotImplementedException();
}
/// <inheritdoc />
public object Create(PropertyInfo PropertyInfo)
{
return this;
}
/// <inheritdoc />
public void Detach(PropertyViewItem property)
{
//throw new NotImplementedException();
}
#endregion Implementation of ITypeEditor
}
|
<Window.Resources>
<Style TargetType="{x:Type syncfusion:DateTimeEdit}">
<Setter Property="Pattern" Value="FullDateTime"/>
</Style>
</Window.Resources> |