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.1.dll
NuGet Package: DevExpress.Wpf.Scheduling
Declaration
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