I need a field within the XamDataGrid to display a property whose underlying type is DateTime based on a format I specify. Right now, I have the getter of this field returning a string instead of a DateTime structure and this is not acceptable.
How do I go about doing this?
Thanks,
Klaus
Hi knji,
I would advise you to use the xamDateTimeEditor as a Field in your xamDataGrid.An important feature of the xamDateTimeEditor control is its ability to be embeddedin a xamDataGrid Field. This feature allows you to take advantage of the editor's full potential while modifying a cell's value.You could get an introduction to the xamDateTimeEditor control, and its key features and functionalities from the following links:
1. Using xamDateTimeEditor as a Field in xamDataGrid <http://help.infragistics.com/Help/NetAdvantage/WPF/2008.2/CLR3.X/html/xamDateTimeEditor_Using_xamDateTimeEditor_as_a_Field_in_xamDataGrid.html>
2. XamDateTimeEditor Class <http://help.infragistics.com/Help/NetAdvantage/WPF/2008.2/CLR3.X/html/Infragistics3.Wpf.Editors.v8.2~Infragistics.Windows.Editors.XamDateTimeEditor.html>
3. XamDateTimeEditor<http://forums.infragistics.com/forums/t/15316.aspx>
Best Regards,Yanko
Very well, thanks.
All that works nicely but how now I want to specify my own mask. The available option for date {date} is not sufficient for my application.
I want to display date as long date i.e Thursday Dec 11, 2008, Dec 11, 2008 or RFC 1123 Pattern within the grid. From the look of things I need to be creating a custom mask. Any pointers will also be appreciated.
Thank you.
Klaus.
For otherws who run into this question, setting the 'Format" property of the underlying ValueEditor as shown below, allows me to also customize how a DateTime field is displayed.
<igDP:Field Name="TransmitTime" Visibility="Collapsed"> <igDP:Field.Settings> <igDP:FieldSettings> <igDP:FieldSettings.EditorStyle> <Style x:Name="timeEditor" TargetType="{x:Type igEditors:XamDateTimeEditor}" > <Setter Property="Format" Value="R" /> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field>