This example illustrates multiple techniques used to set the time cell background in a scheduler grouped by resources:
In classic themes, a cell background color depends on the resource color. Use the following properties to specify the resource color:
<dxsch:DataSource.ResourceMappings>
<dxsch:ResourceMappings Brush="Brush"
Caption="Caption"
Id="Id"/>
</dxsch:DataSource.ResourceMappings>
Use the BrushSet property to declare a custom resource brush set. Refer to the following help topic for more information: Brushes and Customization.
<dxsch:SchedulerControl.BrushSet>
<dxsch:BrushSet>
<dxsch:BrushInfo Name="{x:Static dxsch:DefaultBrushNames.Resource1}"
Brush="OrangeRed"/>
<dxsch:BrushInfo Name="{x:Static dxsch:DefaultBrushNames.Resource2}"
Brush="YellowGreen"/>
</dxsch:BrushSet>
</dxsch:SchedulerControl.BrushSet>
Use the BrushProvider property to declare a custom resource provider set. Refer to the following help topic for more information: Brush Provider.
<dxsch:SchedulerControl.BrushProvider>
<dxsch:BrushProvider DefaultDarkCellBackground="LightCoral"
DefaultLightCellBackground="LightSeaGreen"
ResourceDarkCellBackground="{dxsch:OverrideBrushTransform OverrideBrush=LightGreen}"
ResourceLightCellBackground="{dxsch:OverrideBrushTransform OverrideBrush=LightBlue}"/>
</dxsch:SchedulerControl.BrushProvider>
Use the Time Regions feature to highlight specific time frames.
<dxsch:DataSource AppointmentsSource="{Binding Appointments}"
ResourcesSource="{Binding Resources}"
TimeRegionsSource="{Binding TimeRegions}">
<dxsch:DataSource.TimeRegionMappings>
<dxsch:TimeRegionMappings Brush="Brush"
End="EndTime"
Id="Id"
ResourceId="ResourceId"
Start="StartTime"/>
</dxsch:DataSource.TimeRegionMappings>
</dxsch:DataSource>
Use the CellStyle
property to declare a custom cell style for a view, as demonstrated in previous versions of this example.
- WPF Scheduler - Highlight Time Intervals
- WPF Scheduler - Customize Appointment Appearance
- WPF Scheduler - Handle the CustomAppointmentBackground Event to Change the Appointment Background
- WPF Scheduler - Customize the Appointment Flyout and Tooltip
- WPF Scheduler - Disable Resource Colorization
(you will be redirected to DevExpress.com to submit your response)