We recentrly upgraded to Infragistics 2009.2 version of the WPF controls and noted that xamDateTimeEditor which was working fine with previous version started giving validation error.
Basically the mask was set as "dd/mm/yyyy hh:mm" and you could just select a date from the drop down and it will set the time to 00:00 automatically when you Tab out of it but now it pops up messagebox saying Value is in valid and the time part remain blank ( not set to 00:00 anymore).
Can someone please suggest a way so that the behaviour remain as it was and no messagebox is displayed.
Thank you
We have now upgraded to 2010 Volume 1 and it has been noted that if we host the control within a tab and change tabs away from the date control and back to the date control it looses the time part.
The code we have is:
'' Date tie fix as suggested by Infragistics
''http://forums.infragistics.com/forums/t/32250.aspx
Dim oBinding As New Binding
oBinding.Path =
New PropertyPath("Value")
oBinding.Mode =
BindingMode.TwoWay
oBinding.RelativeSource =
RelativeSource.Self
BindingOperations.SetBinding(Me, PIMSXAMDateTimeEditor.DateValueProperty, oBinding)
Please advise on another possible way to handle this?
Kind regards
Rob
Thank you. Its working.
Regards
This is actually related to a bug fix/behavior change. Essentially the original template of the xamDateTimeEditor in 8.2 had the SelectedDate of the xamMonthCalendar in the template bound to the Value property of the xamDateTimeEditor. Since the dates of the xamMonthCalendar don't have time information (or more accurately have 00:00:00 - i.e. midnight), this meant that if you had a mask that included time portions when you would select a date from the dropdown it would overwrite the time information the user had in the edit portion with 00:00:00. We changed this back in March to instead bind the SelectedValue of the xamMonthCalendar to a new property on the xamDateTimeEditor named DateValue. When this property is set, we only update the date sections of the mask with the information from the new date value. This means that selecting a date does not set the time portion ever.
If you want the previous behavior that would overwrite the time portion I can think of a couple of options:
1) You could do a two way binding between the DateValue and Value.
2) You could modify the template of the xamDateTimeEditor so that the SelectedValue is bound to the Value property instead of the DateValue. The default xaml is shipped with the product in the DefaultStyles directory and you can use that as the basis for your template. Note there are different templates for different themes so this may be difficult to manage.
You may also want to submit a suggestion for adding an AutoFillTime property.