Is there a way to enable /disable specific dates on a XamDateTime editor control. This functionality seems to be available in the XamMonthCalendar control and I am able to do this to achieve disabled dates.
For Each itm In datelist
Dim range As CalendarDateRange = New CalendarDateRange(Convert.ToDateTime(itm.Value))
igCalendar.DisabledDates.Add(range)
Next
Or is there a way I can port this functionality from the XamMonthCalendar to the XamDateTimeEditor
Hi Chetan,
It turns out the reason the XamDateTimeEditor was slow was because the ValueConstraint was set with a string. If you set the value with an explicit DateTime object, the delay goes away. This makes sense since an implicit converter is being called which apparently slows down the control.
Instead of the following:
<igEditors:XamDateTimeEditor> <igEditors:XamDateTimeEditor.ValueConstraint> <igEditors:ValueConstraint MinInclusive="01/01/1753"> </igEditors:XamDateTimeEditor.ValueConstraint></igEditors:XamDateTimeEditor>
Use this:
<igEditors:XamDateTimeEditor> <igEditors:XamDateTimeEditor.ValueConstraint> <igEditors:ValueConstraint> <igEditors:ValueConstraint.MinExclusive> <sys:DateTime>01/01/1753</sys:DateTime> </igEditors:ValueConstraint.MinExclusive> </igEditors:ValueConstraint> </igEditors:XamDateTimeEditor.ValueConstraint></igEditors:XamDateTimeEditor>
Thanks!
Hello Chetan,
If you feel like there is a serious performance issue in this control, please open a developer support case reporting this as a bug. I'm surprised to hear that you see this happening. A sample project demonstrating the slow down would be helpful for us.http://es.infragistics.com/support/submitrequest.aspx
You could also try putting the constraint into your data source/view model class. Putting logic into the Model or View Model is always a good optimization rather than putting it into the View. The many logic-based features in the VIew are convenient and helpful. However, whenever you need to make the UI as light-weight as possible, sometimes it helps to optimize what is happening in the UI.
Thanks,
Hi Curtis,
I am using XamDateTimeEditor and applying ValueConstraint as follows
InfraEditor:XamDateTimeEditor.ValueConstraint>
<InfraEditor:ValueConstraint MinInclusive="01/01/1753">
</InfraEditor:ValueConstraint>
</InfraEditor:XamDateTimeEditor.ValueConstraint>
This adds slowness when I access the control while entering date. Is there any way to avoid this slowness or is there any other way to keep ValueConstraint to the control.
I'm glad I can help. It sounds like you found your answer. Good luck with your further programming endeavors!
Clarification: Just realized that OnApplyTemplate() is getting called again when the drop down opens. Sorry, I missed that on the first pass. So, after the Template is applied that does contain the "PART_Calendar" item, I can save a reference to it an modify my DisabledDates as needed.
Thanks for the good info.