Class ScheduleToolBarCustom
Represents a custom toolbar item component that allows you to add custom content or specific item types to the SfSchedule<TValue> toolbar.
Inherited Members
Namespace: Syncfusion.Blazor.Schedule
Assembly: Syncfusion.Blazor.dll
Syntax
public class ScheduleToolBarCustom : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Remarks
The ScheduleToolBarCustom component enables you to add custom elements such as buttons, input fields, spacers, separators, or other UI elements to the SfSchedule<TValue> toolbar.
This component must be placed within a ScheduleToolBar component, which in turn must be within a SfSchedule<TValue> component.
The component can be rendered without specifying the Type parameter; in this case, it defaults to Button. When rendering input elements within the custom toolbar item, it is mandatory to set the Type parameter to Input.
Examples
Demonstrates how to use the ScheduleToolBarCustom to add a custom button that updates the scheduler's selected date.
<SfSchedule TValue="AppointmentData" @ref="Scheduler" @bind-SelectedDate="@SelectedDate">
<ScheduleToolBar>
<ScheduleToolBarCustom>
<button @onclick="OnCustomClick">Go to End Date</button>
</ScheduleToolBarCustom>
</ScheduleToolBar>
</SfSchedule>
@code {
private SfSchedule<AppointmentData> Scheduler;
private DateTime SelectedDate { get; set; } = DateTime.Today;
private async Task OnCustomClick()
{
SelectedDate = DateTime.Today.AddDays(10);
await Scheduler.RefreshEventsAsync();
}
public class AppointmentData
{
public string Subject { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
}
}
Constructors
ScheduleToolBarCustom()
Declaration
public ScheduleToolBarCustom()
Properties
ChildContent
Gets or sets the custom content to be rendered within the toolbar tool.
Declaration
[Parameter]
public RenderFragment ChildContent { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderFragment | A RenderFragment containing custom content for the toolbar tool. The default value is null. If not specified, no content is rendered. |
Remarks
This property allows to define custom UI elements, such as a button, dropdowns, or other components, to implement specific actions within the toolbar.
Examples
Demonstrates adding a custom button to the ScheduleToolBarCustom.
<SfSchedule TValue="AppointmentData" @ref="Scheduler" @bind-SelectedDate="@SelectedDate">
<ScheduleToolBar>
<ScheduleToolBarCustom>
<button @onclick="OnCustomClick">Go to End Date</button>
</ScheduleToolBarCustom>
</ScheduleToolBar>
</SfSchedule>
@code {
private SfSchedule<AppointmentData> Scheduler;
private DateTime SelectedDate { get; set; } = DateTime.Today;
private async Task OnCustomClick()
{
SelectedDate = DateTime.Today.AddDays(10);
await Scheduler.RefreshEventsAsync();
}
public class AppointmentData
{
public string Subject { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
}
}
Type
Gets or sets the type of the toolbar item to render.
Declaration
[Parameter]
public ItemType Type { get; set; }
Property Value
| Type | Description |
|---|---|
| ItemType | One of the ItemType enumeration values. The default value is Button. |
Remarks
The component can be rendered without specifying the Type parameter; in this case, it defaults to Button. When rendering input elements within the custom toolbar item, it is mandatory to set the Type parameter to Input.
This property determines how the custom toolbar item is rendered:
- ButtonRenders the custom content as a button-type toolbar item. This is the default type when not specified.
- InputRenders the custom content as an input-type toolbar item. Use this type when adding input elements such as textboxes or search fields. It is mandatory to set this type when rendering input elements.
- SpacerRenders a flexible spacer that pushes subsequent toolbar items to the right, creating dynamic spacing between toolbar elements.
- SeparatorRenders a vertical separator line to visually divide groups of toolbar items.
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTreeBuilder | __builder |
Overrides
Dispose(bool)
Disposes 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()
Declaration
protected override Task OnInitializedAsync()
Returns
| Type |
|---|
| Task |