CellControl Class
A base class for classes which visualize a time cell in a scheduler view.
Namespace: DevExpress.Xpf.Scheduling.Visual
Assembly: DevExpress.Xpf.Scheduling.v22.1.dll
NuGet Package: DevExpress.Wpf.Scheduling
Declaration
Example
You can create a data template, define a cell style and assign the style to the appropriate property of the desired view:
- Day view, Work-Week view, Week view - use the DayViewBase.AllDayCellStyle and DayViewBase.CellStyle properties
- Month view - use the MonthView.CellStyle property
- Timeline view - use the TimelineView.CellStyle property
The following code demonstrates a custom cell style and template applied to the selected cells of the resource with ID=1. A custom data template displays the time interval contained in the cell’s data context.
<Style x:Key="CellControl.Style" TargetType="dxschv:CellControl">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Value="1" Binding="{Binding Resource.Id}" />
<Condition Value="True" Binding="{Binding IsSelected}" />
</MultiDataTrigger.Conditions>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel Background="Black">
<dxschv:FastTextBlock
HorizontalAlignment="Center"
Foreground="White"
FontSize="10"
Text="{Binding Interval}"
WordWrap="True" />
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</MultiDataTrigger>
</Style.Triggers>
</Style>
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the CellControl 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.