Back to Devexpress

SchedulerControl.DataSource Property

wpf-devexpress-dot-xpf-dot-scheduling-dot-schedulercontrol-2e959a53.md

latest6.1 KB
Original Source

SchedulerControl.DataSource Property

Gets or sets the data source object for the SchedulerControl. This is a dependency property.

Namespace : DevExpress.Xpf.Scheduling

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

NuGet Package : DevExpress.Wpf.Scheduling

Declaration

csharp
public DataSource DataSource { get; set; }
vb
Public Property DataSource As DataSource

Property Value

TypeDescription
DataSource

An object exposing the IDataSourceBase interface (e.g., the DataSource object) that is the Scheduler’s data source.

|

Remarks

Use the DataSource property to provide the data source and mappings for the scheduler’s appointments, resources, labels and status.

We recommend using the window DataContext to specify bindings to the DataSource object’s properties in XAML.

Example

View Example

xaml
<dxsch:SchedulerControl.DataSource>
    <dxsch:DataSource ResourcesSource="{Binding Doctors}" AppointmentsSource="{Binding Appointments}">
        <dxsch:DataSource.ResourceMappings>
            <dxsch:ResourceMappings Caption="Name" Id="Id"/>
        </dxsch:DataSource.ResourceMappings>
        <dxsch:DataSource.AppointmentMappings>
            <dxsch:AppointmentMappings
                                        Type="Type"
                                        StatusId="StatusId"
                                        Start="StartTime"
                                        Subject="PatientName"
                                        ResourceId="DoctorId"
                                        RecurrenceInfo="RecurrenceInfo"
                                        Reminder="ReminderInfo"
                                        LabelId="CategoryId"
                                        Location="Location"
                                        Id="Id"
                                        End="EndTime"
                                        Description="Notes"
                                        AllDay="AllDay">
                <dxsch:CustomFieldMapping Mapping="InsuranceNumber" Name="InsuranceNumber"/>
                <dxsch:CustomFieldMapping Mapping="FirstVisit" Name="FirstVisit"/>
            </dxsch:AppointmentMappings>
        </dxsch:DataSource.AppointmentMappings>
    </dxsch:DataSource>

The following code snippets (auto-collected from DevExpress Examples) contain references to the DataSource property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-scheduler-use-scheduler-report-to-print-and-export-appointments/CS/PrintingExample/MainWindow.xaml#L43

xml
</dxmvvm:Interaction.Behaviors>
<dxsch:SchedulerControl.DataSource>
    <dxsch:DataSource AppointmentsSource="{Binding Appointments}" ResourcesSource="{Binding Doctors}">

wpf-scheduler-generate-time-scales-from-view-model-collection/CS/WpfSchedulerTimelineScalesTemplate/MainWindow.xaml#L42

xml
<dxsch:TimelineView x:Name="timelineView" IntervalCount="8" TimeScalesSource="{Binding TimeScales}" TimeScaleTemplateSelector="{StaticResource TimeScaleTemplateSelector}"/>
<dxsch:SchedulerControl.DataSource>
    <dxsch:DataSource AppointmentsSource="{Binding Appointments}" ResourcesSource="{Binding Calendars}">

wpf-scheduler-highlight-time-intervals/CS/SchedulerCellTemplate/MainWindow.xaml#L31

xml
SnapToCellsMode="Never" DayCount="5" TimeScale="00:30:00" />
<dxsch:SchedulerControl.DataSource>
    <dxsch:DataSource AppointmentsSource="{Binding Appointments}" ResourcesSource="{Binding Calendars}"

wpf-scheduler-implement-custom-mapping-converter-for-color-values/CS/ColorMappingExample/MainWindow.xaml#L36

xml
<dxsch:SchedulerControl x:Name="scheduler" Grid.Row="1">
    <dxsch:SchedulerControl.DataSource>
        <dxsch:DataSource AppointmentLabelsSource="{Binding Categories}" AppointmentsSource="{Binding Appointments}">

wpf-scheduler-obtain-selected-appointment-resource-and-time-interval/CS/DXSchedulerSelection/MainWindow.xaml#L56

xml
VisibleTime="06:00:00-21:00:00" />
<dxsch:SchedulerControl.DataSource>
    <dxsch:DataSource

See Also

SchedulerControl Class

SchedulerControl Members

DevExpress.Xpf.Scheduling Namespace