Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
415
Attemping to create custom control... One simple step left - please help
posted

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.

Parents
No Data
Reply
  • 69832
    Suggested Answer
    Offline posted

    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.

Children