Back to Devexpress

DataSource Class

wpf-devexpress-dot-xpf-dot-scheduling-4fc3d7bb.md

latest6.5 KB
Original Source

DataSource Class

An object that specifies data sources and mappings for the Scheduler objects.

Namespace : DevExpress.Xpf.Scheduling

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

NuGet Package : DevExpress.Wpf.Scheduling

Declaration

csharp
public class DataSource :
    DXFrameworkContentElement,
    IDataSourceBase
vb
Public Class DataSource
    Inherits DXFrameworkContentElement
    Implements IDataSourceBase

The following members return DataSource objects:

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 class.

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#L44

xml
<dxsch:SchedulerControl.DataSource>
    <dxsch:DataSource AppointmentsSource="{Binding Appointments}" ResourcesSource="{Binding Doctors}">
        <dxsch:DataSource.AppointmentMappings>

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

xml
<dxsch:SchedulerControl.DataSource>
    <dxsch:DataSource AppointmentsSource="{Binding Appointments}" ResourcesSource="{Binding Calendars}">
        <dxsch:DataSource.AppointmentMappings>

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

xml
<dxsch:SchedulerControl.DataSource>
    <dxsch:DataSource AppointmentsSource="{Binding Appointments}" ResourcesSource="{Binding Calendars}"
                      TimeRegionsSource="{Binding TimeRegions}"

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

xml
<dxsch:SchedulerControl.DataSource>
    <dxsch:DataSource AppointmentLabelsSource="{Binding Categories}" AppointmentsSource="{Binding Appointments}">
        <dxsch:DataSource.AppointmentMappings>

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

xml
<dxsch:SchedulerControl.DataSource>
    <dxsch:DataSource
        AppointmentLabelsSource="{Binding SportGroups}"

Implements

IDataSourceBase

Inheritance

Object DispatcherObject DependencyObject ContentElement FrameworkContentElement DXFrameworkContentElement DataSource

See Also

DataSource Members

How to: Bind Scheduler to Data using Entity Framework

How to: Create Custom Labels and Statuses

DevExpress.Xpf.Scheduling Namespace