Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DXCalendar.DayCellTemplate Property

Gets or sets a data template used to render days. This is a bindable property.

Namespace: DevExpress.Maui.Editors

Assembly: DevExpress.Maui.Editors.dll

NuGet Package: DevExpress.Maui.Editors

#Declaration

C#
public DataTemplate DayCellTemplate { get; set; }

#Property Value

Type Description
DataTemplate

The template.

#Remarks

The CalendarCellData class specifies the binding context for the DayCellTemplate. You can use the following properties to implement the template:

  • Date - Returns the date the calendar cell displays.
  • IsSelected - Returns whether the calendar cell is selected.
  • IsTrailing - Returns whether the calendar displays days related to the previous and next months.

The following example configures a template that specifies calendar cell appearance:

DevExpress Calendar for .NET MAUI - Configure day cell template

<dxe:DXCalendar.DayCellTemplate>
    <DataTemplate>
        <Grid>
            <Border Stroke="Red" StrokeThickness="2" IsVisible="{Binding IsSelected}" BackgroundColor="LightGray"/>
            <Label Text="{Binding Path=Date.Day}" VerticalOptions="Center" HorizontalOptions="Center">
                <Label.Triggers>
                    <DataTrigger TargetType="Label" Binding="{Binding IsTrailing}" Value="True">
                        <Setter Property="TextColor" Value="Orange"/>
                    </DataTrigger>
                </Label.Triggers>
            </Label>
        </Grid>
    </DataTemplate>
</dxe:DXCalendar.DayCellTemplate>
See Also