Back to Devexpress

How to: Customize Time Cells via Templates

aspnet-5875-components-scheduler-examples-customization-appearance-how-to-customize-time-cells-via-templates.md

latest1.1 KB
Original Source

How to: Customize Time Cells via Templates

  • Sep 25, 2023

You can modify the time cell appearance with ease. It is possible because time cells support the editable in-line web templates. Currently there are three templates. The DayView time cells are rendered using the TimeCellBodyTemplate , the WeekView cells are rendered using the DateCellBodyTemplate and the TimelineView time cells are rendered with the help of the TimelineCellBodyTemplate

You can use the in-line time cell templates to display the time interval of the current time cell, as demonstrated by the following ASPx page snippet:

aspx
<DayView>
    <TimeRulers>
        <cc1:timeruler></cc1:timeruler>
    </TimeRulers>
    <Templates>
        <TimeCellBodyTemplate>
            <div style="width:100%; text-align:center;">
                <%# Container.Interval.Start %>
            </div>
        </TimeCellBodyTemplate>
    </Templates>
</DayView>