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
690
UltraMonthViewSingle: InitializeWeek events firing too early
posted

We're hooking up events to InitializeWeek.  We're also subclassing UltraMonthViewSingle so that we can assign our default values to properties in the constructor of the derived class.

We've noticed that the three Initialize events (Day, Week, Month) will fire off as soon as we set some of the control's properties.  These are the properties we've identified as causing the immediate firing:

                CalendarInfo.FirstDayOfWeek
                CalendarInfo.MaxSelectedDays
                CalendarInfo.SelectTypeActivity

                WeekHeaderDisplayStyle

Our assumption is that the control shouldn't behave this way as we're not aware of UltraGrid or other controls in the library firing Initialize events this early.

Should we be using the control differently, or is our assumption correct?

Thanks

Parents
No Data
Reply
  • 69832
    Suggested Answer
    Offline posted

    All the Initialize events fire when something triggers the creation of the corresponding object; for example, if something causes a Week object to be created, the InitializeWeek event is fired. When you access an UltraCalendarInfo property, the get method might need to create the object in order to return the correct value, hence the firing of the event.

Children