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
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
Hi Peter,
The problem is solved.
Thank You
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
Hello,
I have investigated this further and have a solution to what I think is your requirement. You have string date which you want use as DateTime in the XamDataGrid (for sorting, and have it formatted as “DD MMM yyyy” ) and want to export to excel as string. What you can do is use this xaml snippet:
<igDP:Field Name="StringBirthDay">
<igDP:Field.Settings>
<igDP:FieldSettings >
<igDP:FieldSettings.EditorStyle>
<Style TargetType="{x:Type igEditors:XamDateTimeEditor}">
<Setter Property="Format" Value="ddd MMM yyyy"/>
</Style>
</igDP:FieldSettings.EditorStyle>
</igDP:FieldSettings>
</igDP:Field.Settings>
</igDP:Field>
to have the application view you want. And handle the CellExporting event of the DataPresenterExcelExporter to format it the same way - http://help.infragistics.com/Help/NetAdvantage/WPF/2010.3/CLR4.0/html/InfragisticsWPF4.DataPresenter.ExcelExporter.v10.3~Infragistics.Windows.DataPresenter.ExcelExporter.DataPresenterExcelExporter~CellExporting_EV.html
Please let me know if you require any further assistance on the matter.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
I m also trying to use sort comparer. But I am having problem convert string DD MMM yyyy to DateTime or format of yyyyMMdd.