Back to Devexpress

MonthView.CellStyle Property

wpf-devexpress-dot-xpf-dot-scheduling-dot-monthview-d9da9d37.md

latest3.1 KB
Original Source

MonthView.CellStyle Property

Gets or sets the style of time cells in the Month View. This is a dependency property.

Namespace : DevExpress.Xpf.Scheduling

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

NuGet Package : DevExpress.Wpf.Scheduling

Declaration

csharp
public Style CellStyle { get; set; }
vb
Public Property CellStyle As Style

Property Value

TypeDescription
Style

A Style object that represents a style to be applied to time cells.

|

Remarks

The CellStyle property specifies the style that groups together properties, resources, and event handlers and shares them between instances of the target type.

Target Type : DevExpress.Xpf.Scheduling.Visual.MonthCellControl or the base DevExpress.Xpf.Scheduling.Visual.CellControl.

Example

The code sample below defines and applies a cell style, which hides grid lines and changes the background color to white in the SchedulerControl’s views.

xaml
<Window.Resources>
    <Style x:Key="CellControl.Style" TargetType="{x:Type dxschv:CellControl}">
        <Setter Property="BottomBorderThickness" Value="0" />
        <Setter Property="LeftBorderThickness" Value="0" />
        <Setter Property="Background" Value="White" />
        <Setter Property="SelectedBackground" Value="White" />
    </Style>
    <Style TargetType="{x:Type dxsch:DayView}">
        <Setter Property="CellStyle" Value="{StaticResource CellControl.Style}" />
    </Style>
    <Style TargetType="{x:Type dxsch:WorkWeekView}">
        <Setter Property="CellStyle" Value="{StaticResource CellControl.Style}" />
    </Style>
    <Style TargetType="{x:Type dxsch:WeekView}">
        <Setter Property="CellStyle" Value="{StaticResource CellControl.Style}" />
    </Style>
    <Style TargetType="{x:Type dxsch:MonthView}">
        <Setter Property="CellStyle" Value="{StaticResource CellControl.Style}" />
    </Style>
    <Style TargetType="{x:Type dxsch:TimelineView}">
        <Setter Property="CellStyle" Value="{StaticResource CellControl.Style}" />
    </Style>
</Window.Resources>

Refer to the following example for more information on available cell customization techniques:

View Example: Customize Cell Colors

See Also

AppointmentStyle

MonthView Class

MonthView Members

DevExpress.Xpf.Scheduling Namespace