We have two date controls as From and To and have validation of each date, if validation fails user should stay on the same field. Also we want date control to appear with date mask ( / / ) and dropdown icon.
I was able to do this with following settings and validation code with setting focus (not given here)
<igEditors:XamDateTimeEditor DropDownButtonDisplayMode="Always"
DisplayMode="IncludeBoth" IsAlwaysInEditMode="True"/>
Issues that we are having now as below,
1. We used IsAlwaysInEditMode="True" to make the mask appear to the user without actually start entering the date. But this is causing date value not being notified to view model. This may be because IsAlwaysInEditMode="True" means EditModeStarted and EditModeEnded will be ignored with this setting.
2. We used DropDownButtonDisplayMode="Always" to show the dropdown to the user without actually mouse over on the date control. This is causing user to leave the one date control with the business errored date to the other when user click the dropdown icon of the other date control.
Please guide us in the right direction, Thanks
I have used NullText property, which worked for my scenario
Sorry, It is working correctly. It was my mistake in the coding which was causing issue. This is now resolved for me. Thanks for your help
Now I got a problem with our Dirty Tracking, When the I set the (val = "__/__/____") for date that has empty value, it actally fires the change event once again, which we do not want to happen. We want our change event fire when user manually clear the date, not when window loaded with default date. Any suggestion how to overcome this issue?
Thanks for your help, finally I was able to make it work by changing it to val = "__/__/____". I don't why maskEditor.Text is empty string, but maskEditor.GetText(MaskMode.IncludeBoth) is giving the old value which was set to nothing from the ViewModel.
I am glad your suggestion help, thanks you for your help.
Public Function Convert(ByVal value As Object, ByVal targetType As System.Type, ByVal parameter As Object, ByVal culture As System.Globalization.CultureInfo) As Object Implements
System.Windows.Data.IValueConverter.Convert
Dim val As Object = g_baseDisplayTextConverter.Convert(value, targetType, parameter, culture)
Dim maskEditor As XamMaskedEditor = TryCast(parameter, XamMaskedEditor)
If maskEditor IsNot Nothing Then
If val Is Nothing OrElse TypeOf val Is String AndAlso 0 = DirectCast(val, String).Length Then
' val = maskEditor.GetText(MaskMode.IncludeBoth)
val =
"__/__/____"
End If
Return val
End Function
Hello
Have you managed to resolve this issue ? Is there any update ? Thanks.