Requirements: the xamdatagrid has a field that would display the Time in the format "hh:mm".
That sounds simple enough? I added a xamDateTimeEditor and set the mask property to {}{time}. It doesn't work since it's showing the year in the editor. If the value is 2007-03-03 08:35:00 , the editor is showing 20:07 . How do I set the DisplayFormat?
Here's my field:
<igDP:UnboundField Label="Time" BindingPath="TreatmentTime" Row="1" Column="5" BindingMode="TwoWay">
<igDP:UnboundField.Settings>
<igDP:FieldSettings Width="50" EditorType="{x:Type igEditors:XamDateTimeEditor}" LabelClickAction="Nothing">
<igDP:FieldSettings.EditorStyle>
<Style TargetType="{x:Type igEditors:XamDateTimeEditor}">
<Setter Property="Mask" Value="{}{time}" />
</Style>
</igDP:FieldSettings.EditorStyle>
</igDP:FieldSettings>
</igDP:UnboundField.Settings>
</igDP:UnboundField>
I'm still struggling with that one. How can I Edit the Time part only of a DateTime in my xamDataGrid?
Hello,
void xamDataGrid1_FieldLayoutInitialized(object sender, Infragistics.Windows.DataPresenter.Events.FieldLayoutInitializedEventArgs e)
{
Style s = new Style(typeof(XamDateTimeEditor));
s.Setters.Add(new Setter(XamDateTimeEditor.FormatProperty, "hh:mm:ss"));
s.Setters.Add(new Setter(XamDateTimeEditor.MaskProperty, "{time}"));
e.FieldLayout.Fields["DateTime"].Settings.EditorStyle = s;
}
Does this work for you? See attached project.
Edit : Please note that the XamDateTime editor does not support editing the time portion. Instead, a masked editor is used.