I would like to use the following style for my XamDateTimeEditor fields:
<Style TargetType="{x:Type igEditor:XamDateTimeEditor}">
<Setter Property="Format" Value="yyyy-MM-dd" />
</Style>
This works fine, when displaying the dates. However, when I click on the drop-down button to show the calendar, the format switches to the default MM/dd/yyyy. It then reverts back to the corect style once I hide the calendar.
Is there any way to keep the style consistent?
Hi Pavel,
Glad I could help. Please let me know if you have further questions.
Hello,
The following change has resolved my issue:
<Setter Property="Mask" Value="yyyy-mm-dd"/>
Thanks for your help,
Pavel
The following style handles the format of the date in a xamDataGrid field when it is in or not in edit mode, so that it will displays in the same format.
<igWPF:Field Name="Date" Label="Test Date"
DataType="{x:Type sys:DateTime}">
<igWPF:Field.Settings>
<igWPF:FieldSettings >
<igWPF:FieldSettings.EditorStyle>
<Style TargetType="{x:Type igWPF:XamDateTimeEditor}">
<Setter Property="Format" Value="yyyy-MM-dd"/>
</igWPF:FieldSettings.EditorStyle>
</igWPF:FieldSettings>
</igWPF:Field.Settings>
</igWPF:Field>
You mention a date when the control drops down and the calendar is exposed. I'm not sure if you are referring to the Today button’s format. The format reflects the Culture or the Language setting. However, if you need to re-template the control you can do so by using a copy of the original templates for the style TodayButtonStyleKey (default path: C:\Program Files (x86)\Infragistics\NetAdvantage 2013.2\WPF\DefaultStyles ). Look for the Editors\EditorsGeneric.xaml file.
Here is a forum post by Petar which includes a sample using a converter and the TodayButtonStyleKey style to format the date.
http://es.infragistics.com/community/forums/t/45558.aspx
Please let me know if this answers your question.