I am attempting to override the UltraCalendarCombo so that when a user clicks a date, that date toggles on or off, and an unlimited amount of dates can be selected. I have gotten everything working except I can't seem to figure out how to prevent the datepicker from closing when a date is clicked.
Of course just my luck there is a BeforeDrop and AfterDrop but only an AfterClosing, no before. Here is my Code so far:
public class MyDatePicker : UltraCalendarCombo {
StreamWriter sw;
public MyDatePicker() {
}
protected override void CalendarInfoChanged(CalendarInfoChangedEventArgs e) {
if( e.PropChangeInfo.PropId.ToString() != "ActiveDay" ) {
base.CalendarInfoChanged( e );
else {
UltraCalendarInfo info = e.PropChangeInfo.Source as UltraCalendarInfo;
DateTime newDate = info.ActiveDay.Date;
UltraCalendarLook calendarLook = this.CalendarLook;
DayLook dayLook = calendarLook.GetDayLook( newDate, true );
dayLook.Appearance.BackColor = Color.Aqua;
Strangely enough, calling this.PerformAction( Infragistics.Win.UltraWinSchedule.CalendarCombo.CalendarComboAction. CancelCloseUp ); does not seem to help.
Sorry, there is no way to prevent the dropdown from closing. Dropdown control's don't usually provide a way to prevent this as the user expectes them to close once they select something. You might want to consider using the UltraMonthViewMulti control instead, which is the same control as the calendar that drops down, with no edit portion. In that case you would have to handle the date parsing with a TextBox or UltraTextEditor.
Ok I tried using a UltraTextEditor with a ButtonRight drop down, this keeps the calender open. What should I override to detect when the using is clicking a date?
You can handle the MouseClick event, and use the GetDayFromPoint method to determine the date that was clicked (remember to check for a null return).