Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

FetchDataEventArgs.Ids Property

Returns the identifiers of scheduler items that have been reloaded by the ReloadAppointments/ReloadTimeRegions methods.

Namespace: DevExpress.Xpf.Scheduling

Assembly: DevExpress.Xpf.Scheduling.v24.2.dll

NuGet Package: DevExpress.Wpf.Scheduling

#Declaration

public IReadOnlyList<object> Ids { get; }

#Property Value

Type Description
IReadOnlyList<Object>

A list of objects that identify scheduler items to fetch.

#Remarks

If you use the ReloadAppointments/ReloadTimeRegions methods to manually reload the scheduler items from the data source, the Ids property allows you to obtain the identifiers of the items.

If the fetch event has not been triggered by the ReloadAppointments/ReloadTimeRegions methods, the Ids property returns null.

The code snippet below illustrates the FetchAppointments event implementation.

scheduler.ReloadAppointment(new[] { id1, id2 });
//...
public void FetchAppointments(FetchDataEventArgs args) {
    using(var dbContext = new SchedulingContext()) {
      // event has been fired by the scheduler's initialization or navigation
        if(args.Ids == null)
            // load appointments based on the visible interval
            args.Result = dbContext.AppointmentEntities
                .Where(x => x.QueryStart <= args.Interval.End && x.QueryEnd >= args.Interval.Start)
                .ToArray();
        // event has been fired by the ReloadAppointments method
        else {
            var ids = args.Ids.OfType<int>().ToArray();
            // load the appointments whose identifiers are returned by the Ids property
            args.Result = dbContext.AppointmentEntities
                .Where((x) => ids.Contains(x.Id))
                .ToArray();
        }
    }
}
See Also