Class ScheduleToolBarNewEvent
Represents a toolbar tool for creating a new event in the SfSchedule<TValue> component.
Inherited Members
Namespace: Syncfusion.Blazor.Schedule
Assembly: Syncfusion.Blazor.dll
Syntax
public class ScheduleToolBarNewEvent : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Remarks
This component renders a "New Event" button that opens the scheduler's event editor dialog to create a new appointment in the SfSchedule<TValue> component.
The component requires a reference to the parent ScheduleToolBar and its associated SfSchedule<TValue> component to invoke the event editor dialog.
For optimal performance, ensure the scheduler is configured with the necessary event data model (e.g., "AppointmentData") to support appointment creation.
This component must be placed within a ScheduleToolBar component, which in turn must be within a SfSchedule<TValue> component.
Examples
Demonstrates how to configure the ScheduleToolBarNewEvent to enable creation of new events in the scheduler.
<SfSchedule TValue="AppointmentData">
<ScheduleToolBar>
<ScheduleToolBarNewEvent />
</ScheduleToolBar>
</SfSchedule>
@code {
public class AppointmentData
{
public string Subject { get; set; }
public DateTime StartTime { get; set; }
public DateTime EndTime { get; set; }
}
}
Constructors
ScheduleToolBarNewEvent()
Declaration
public ScheduleToolBarNewEvent()
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 ScheduleToolBarNewEvent 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
- Validates that the component is used within a ScheduleToolBar component and throws an InvalidOperationException if not
- Registers this new event toolbar item with the parent ScheduleToolBar
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when ScheduleToolBarNewEvent is not used within a ScheduleToolBar component. |