ASPxSchedulerDataWebControlBase.FetchAppointments Event
Occurs before the scheduler starts retrieving the appointments for the specified time interval.
Namespace: DevExpress.Web.ASPxScheduler
Assembly: DevExpress.Web.ASPxScheduler.v24.2.dll
NuGet Package: DevExpress.Web.Scheduler
#Declaration
public event FetchAppointmentsEventHandler FetchAppointments
#Event Data
The FetchAppointments event's data class is FetchAppointmentsEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Force |
Gets or sets whether the appointments collection should be reloaded after handling the Scheduler |
Interval |
Gets the time interval which the event was raised for.
Inherited from Time |
#Remarks
Handle the FetchAppointments event to manually provide the scheduler storage with appointment data. This can be useful when working with a large amount of data, and only a small part of it needs to be loaded at one time.
The time interval used to select the appointments is specified by the TimeIntervalEventArgs.Interval property.
Note
Do not clear and populate Scheduler
If the FetchAppointments event is handled, the Scheduler does not rely on its own built-in caching strategy. The FetchAppointments event occurs quite often and in many situations which do not involve any changes in displayed data, such as control resizing. To improve performance, treat these cases as your needs dictate and decide for yourself whether to query the data source for appointment data again or leave the Storage data intact.
Note
The ASPxtrue
, ASPx
See the FetchAppointments Event - Handling Large Datasets document for more information.
The following example illustrates how you can intercept requests for visible interval changes and load only necessary data.
Add a local variable fetchInterval, containing time interval for which the data is obtained from the data source. The query used to fetch the data from the data source has the Start and End parameters, which can be specified to control the amount of fetched data. You can adjust these parameters from within the FetchAppointmens event.