All docs
V20.2
21.1 (EAP/Beta)
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

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.v20.2.dll

Declaration

public IReadOnlyList<object> Ids { get; }
Public ReadOnly Property Ids As IReadOnlyList(Of Object)

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