Class ScheduleTimeScale
A class that represents the time scale configurations on SfSchedule<TValue> component.
Inherited Members
Namespace: Syncfusion.Blazor.Schedule
Assembly: Syncfusion.Blazor.dll
Syntax
public class ScheduleTimeScale : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
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
[Parameter]
public RenderFragment ChildContent { get; set; }
Property Value
| Type | Description |
|---|---|
| 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
[Parameter]
public bool Enable { get; set; }
Property Value
| Type | Description |
|---|---|
| bool | If set to |
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
[Parameter]
public int Interval { get; set; }
Property Value
| Type | Description |
|---|---|
| int | The interval value in minutes. The default value is |
Remarks
This property will have an effect when the Enable property is set to true.
MajorSlotTemplate
Gets or sets template as a RenderFragment<TValue> that defines custom appearance for displaying the major time slot cells.
Declaration
[Parameter]
public RenderFragment<TemplateContext> MajorSlotTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment<TemplateContext> | A template content that specifies the visualization of major time slot cells. The default value is |
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 RenderFragment<TValue> that defines custom appearance for displaying the minor time slot cells.
Declaration
[Parameter]
public RenderFragment<TemplateContext> MinorSlotTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment<TemplateContext> | A template content that specifies the visualization of minor time slot cells. The default value is |
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
[Parameter]
public int SlotCount { get; set; }
Property Value
| Type | Description |
|---|---|
| int | The number of slots to be split. The default value is |
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 |
|---|---|---|
| RenderTreeBuilder | __builder |
Overrides
Dispose(bool)
Dispose unmanaged resources in the Syncfusion Blazor component.
Declaration
protected override void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | Boolean value to dispose the object. |
Overrides
OnInitializedAsync()
Initializes the ScheduleTimeScale component during the component initialization phase.
Declaration
protected override Task OnInitializedAsync()
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |
Overrides
Remarks
This method performs the following initialization tasks:
- Calls the base OnInitializedAsync method
- Updates the parent component with the ScheduleTimeScale configuration
- Caches the current values of all time scale properties for change detection
OnParametersSetAsync()
Handles parameter changes for the ScheduleTimeScale component.
Declaration
protected override Task OnParametersSetAsync()
Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous operation. |
Overrides
Remarks
This method is called whenever component parameters change. It performs the following operations:
- Calls the base OnParametersSetAsync method
- Detects changes in any of the time scale properties (Enable, Interval, SlotCount)
- Updates the cached property values when changes are detected
- Notifies the parent component of the property changes