Skip to content

PrePopulateDay Event

Description

Occurs before the event and is drawn for each day view.

Syntax

Public Event PrePopulateDay( _
    ByVal [ViewDay](#) As [CalendarViewDay](XtremeCalendarControl~CalendarViewDay.md) _
)

Parameters

  • ViewDay: The current day view that is about to be populated.

Remarks

PrePopulateDay is used when needing to display a specific set of resources (MultipleResources) for specific days.

Previous Calendar versions configured a resources set for a view, where all days had the same resources set.

To configure resources for each day separately, we have to call CalendarViewDay.SetMultipleResources. However, the days objects collection is not persistent; it is recreated when the calendar is scrolled or populated.

Therefore, we must use CalendarViewDay.SetMultipleResources inside the PrePopulateDay event handler.

In other words, the PrePopulateDay event handler is the best place to configure each day's resources; otherwise, it becomes too complex to catch each scrolling and set resources for new days.

By default, the Day object takes the resources set from its parent View object, and the View object takes the resources set from the Calendar control.

Now we can customize resources sets for all layers:

  • CalendarControl
  • View
    • Day

Regarding CalendarViewDay.SetMultipleResources, we can set up a full resources set to CalendarControl. For each day, we can copy and set some resources (which we need for that day) from CalendarControl.MultipleResources collection.

See Also


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.