Is it possible to mark bold some dates in DateTimeEditors's calendar? Like paint all Saturdays and Sundays with red or bold? Can you disable dates after today to pick up?
The UltraDateTimeEditor uses a .NET MonthCalendar in its dropdown portion, so theoretically it should also provide all the features that the MonthCalendar does. I didn't see anything exposed that lets you access the MonthlyBoldedDates collection that's on MonthCalendar, though. What you can do is use reflection to get the calendar used in the dropdown and set those dates yourself, i.e.:
private void ultraDateTimeEditor1_AfterDropDown(object sender, EventArgs e){ DateTimeEditor editor = (DateTimeEditor)this.ultraDateTimeEditor1.Editor; PropertyInfo info = typeof(DateTimeEditor).GetProperty("MonthDropDown", BindingFlags.NonPublic | BindingFlags.Instance); MonthDropDown dd = info.GetValue(editor, null) as MonthDropDown; if (dd != null) dd.MonthlyBoldedDates = new DateTime[ { DateTime.Now.AddDays(-1) };}
Note that you have to do this in the AfterDropDown because the control disposes the calendar between dropdown operations. You can use the MonthlyBoldedDates, BoldedDates, or AnnuallyBoldedDates as necessary.
As for painting different dates different colors, I don't think this is possible with the .NET control, so I don't see any way to do it with the UltraDateTimeEditor either.
What do you mean about "Can you disable dates after today to pick up"? If you mean prevent users from selecting any date past today, you could simply set the MaxDate on the control.
-Matt
info always returns null. Are you sure DateTimeEditor has property MonthDropDown?