Hi,
Can you please help me with this. We have a property LastUpdate that has a format of yyyyMMdd. In view I am using converter that formats it as DD MMM yyyy. When I try to sort it sorts incorrectly as it sorts as a string hence 1/10/2010 is less than 2/9/2009. I tried to use EditorStyle the sorts works but there is an export to excel feature. when we export to excel the date format shows as yyyyMMdd as opposed to DD MMM yyyy. I am not able to use both converters at the same time as it shows no value. Can you please help to show this problem. It should show as DD MMM yyyy on UI and also sort as Date.
Thanks, Naveen
Hello Naveen,
What you can do is use the Field's EditAsType property to easily switch between value types. You can set it as DataTime in order to get the desired sorting and switch to String just before you export it.
Hope this helps.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
Hi Peter,
I tried that but I the field is shown as DD/MM/yyyy format on the UI instead of DD MMM yyyy.
Can you tell me how to apply converter to code behind, because I can use the converter before passing it to the Export to excel?
I m also trying to use sort comparer. But I am having problem convert string DD MMM yyyy to DateTime or format of yyyyMMdd.
Hello ,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
If this is what you were looking for please verify the answer so it helps other users as well.
Sincerely,Petar MonovDeveloper Support EngineerInfragistics Bulgariawww.infragistics.com/support
Petar,
I have a question. What if you want the dateformat to be dynamic rather than hard coded in?
Can you use somthing like:
<igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamDateTimeEditor}"> <Setter Property="Format" Value="{Binding DateFormat}"/> </Style> </igDP:FieldSettings.EditorStyle>
I tested it locally, found the above code doesn't work.
Any solution ?
Thanks