Hey Everyone,
Im using the XamDateTimeEditor, and it bound to a DateTime property on my data object.
However, my app support the user working with just a Date and a Date Time. ( 01/01/2008 or 01/01/2008 01:20 PM ).
If the user enters 01/01/2008, I want the control to just display that when the user tabs out. However if the user enters 01/01/2004 02:30 PM, I want it to display that.
When the control goes into edit mode, I want it to always display Date and Time Mask.
Currently when the control is setup to display date time, it forces it to always show date time.
Is there anyway I can configure or code the control to do what Im asking ?
Snippet of my xaml.
<igEditors:XamDateTimeEditor MinWidth="125" Margin="5,5,5,5" x:Name="StartDateTimeEditor" DisplayMode="IncludeBoth" Mask="mm/dd/yyyy {time}" BorderBrush="{Binding ElementName=CalendarComboBox,Path=BorderBrush}" InvalidValueBehavior="RetainValue" DataMode="IncludeLiteralsWithPadding" > <igEditors:XamDateTimeEditor.Text> <Binding Path="StartDate" UpdateSourceTrigger="LostFocus"> <Binding.ValidationRules> <validation:PlanAnalysisDateValidationRule/> </Binding.ValidationRules> </Binding> </igEditors:XamDateTimeEditor.Text> </igEditors:XamDateTimeEditor>
Thanks
Allen
Hey Sandip,
I tried to use my own Converter, and I can see how I can modify what the value converts to for display. Havnt got it to work just yet based on how I want it to behave.
However, I did notice .. as soon as I attached my own converter. When the screen initially get created and databinding happens. The value in the control is BLANK. If I click into the control, it will fill out with what it should have.
Am I doing something wrong or is there another flag I need to set ?
Hi Allen,
One way I can think of is to set the ValueToDisplayTexConverter on the editor to a custom implementation of IValueConverter that converts date time into text - either date only text or date and time text based on the value.
Hope this helps,
Sandip