menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ScheduleTimeScale - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ScheduleTimeScale

    A class that represents the time scale configurations on SfSchedule<TValue> component.

    Inheritance
    System.Object
    ScheduleTimeScale
    Namespace: Syncfusion.Blazor.Schedule
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ScheduleTimeScale : OwningComponentBase
    Remarks

    You can configure the time scale by specifying values for the corresponding properties. Timescale can be applied for Day, Week, WorkWeek, TimelineDay, TimelineWeek and TimelineWorkWeek views.

    Examples

    The following code example shows how to configure the time scale:

    <SfSchedule TValue="AppointmentData">
        <ScheduleTimeScale Enable="true" Interval="60" SlotCount="6"></ScheduleTimeScale>
    </SfSchedule>

    Constructors

    ScheduleTimeScale()

    Declaration
    public ScheduleTimeScale()

    Properties

    ChildContent

    Gets or sets the child content of schedule timescale.

    Declaration
    public RenderFragment ChildContent { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.RenderFragment

    The value used to build the content.

    Enable

    Gets or sets a value indicating whether the schedule should display the appointments accurately against the exact time duration.

    Declaration
    public bool Enable { get; set; }
    Property Value
    Type Description
    System.Boolean

    If set to false, all the appointments of a day will be displayed one below the other. The default value is true.

    Interval

    Gets or sets the time duration on which the time axis should be displayed, either in 1 hour or 30 minutes intervals, etc.

    Declaration
    public int Interval { get; set; }
    Property Value
    Type Description
    System.Int32

    The interval value in minutes. The default value is 60.

    Remarks

    This property will have an effect when the Enable property is set to true.

    MajorSlotTemplate

    Gets or sets template as a Microsoft.AspNetCore.Components.RenderFragment<> that defines custom appearance for displaying the major time slot cells.

    Declaration
    public RenderFragment<TemplateContext> MajorSlotTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.RenderFragment<TemplateContext>

    A template content that specifies the visualization of major time slot cells. The default value is null.

    Remarks

    The time details can be accessed within this template. This property will have an effect when the Enable property is set to true.

    Examples
    <SfSchedule TValue="AppointmentData">
        <ScheduleTimeScale>
            <MajorSlotTemplate>
                <div>@(GetMajorSlotTemplate((context as TemplateContext).Date))</div>
            </MajorSlotTemplate>
        </ScheduleTimeScale>
    </SfSchedule>
    @code{
        public static string GetMajorSlotTemplate(DateTime date)
        {
            return date.ToString("hh", CultureInfo.InvariantCulture);
        }
    }

    MinorSlotTemplate

    Gets or sets template as a Microsoft.AspNetCore.Components.RenderFragment<> that defines custom appearance for displaying the minor time slot cells.

    Declaration
    public RenderFragment<TemplateContext> MinorSlotTemplate { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.RenderFragment<TemplateContext>

    A template content that specifies the visualization of minor time slot cells. The default value is null.

    Remarks

    The time details can be accessed within this template. This property will have an effect when the Enable property is set to true.

    Examples
    <SfSchedule TValue="AppointmentData">
        <ScheduleTimeScale>
            <MinorSlotTemplate>
                <div style="text-align: right; margin-right: 15px">@(GetMinorSlotTemplate((context as TemplateContext).Date))</div>
            </MinorSlotTemplate>
        </ScheduleTimeScale>
    </SfSchedule>
    @code{
        public static string GetMinorSlotTemplate(DateTime date)
        {
            return date.ToString("mm", CultureInfo.InvariantCulture);
        }
    }

    SlotCount

    Gets or sets the number of slots to be split for the specified time interval duration.

    Declaration
    public int SlotCount { get; set; }
    Property Value
    Type Description
    System.Int32

    The number of slots to be split. The default value is 2.

    Remarks

    This property will have an effect when the Enable property is set to true.

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder

    Dispose(Boolean)

    Dispose unmanaged resources in the Syncfusion Blazor component.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    Boolean value to dispose the object.

    OnInitializedAsync()

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type
    System.Threading.Tasks.Task

    OnParametersSetAsync()

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type
    System.Threading.Tasks.Task
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved