Class SfCalendar<TValue>
The Calendar is a graphical user interface component that displays a Gregorian Calendar, and allows a user to select a date.
Inherited Members
Namespace: Syncfusion.Blazor.Calendars
Assembly: Syncfusion.Blazor.dll
Syntax
public class SfCalendar<TValue> : CalendarBase<TValue>
Type Parameters
Name |
---|
TValue |
Constructors
SfCalendar()
Declaration
public SfCalendar()
Properties
ChildContent
Specifies the content that has to be passed.
Declaration
public RenderFragment ChildContent { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.RenderFragment | Accepts a RenderFragment that defines the content of the UI element. |
HtmlAttributes
Gets or sets a collection of additional attributes such as styles, class, and more that will be applied to the component.
Declaration
public Dictionary<string, object> HtmlAttributes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> | The value as dictionary collection.The default value is |
IsMultiSelection
Gets or sets a value indicating whether multiple dates selection is enabled.
Declaration
public bool IsMultiSelection { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
RootClass
Declaration
protected override string RootClass { get; set; }
Property Value
Type |
---|
System.String |
Overrides
TabIndex
Gets or sets the tab index of the component.
Declaration
public int TabIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | Accepts an integer value. |
Values
Gets or sets the collection of DateTime values of the calendar.
Declaration
public DateTime[] Values { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime[] | An array of DateTime values representing the selected dates. |
ValuesChanged
Gets or sets the callback to trigger when the values changes.
Declaration
public EventCallback<DateTime[]> ValuesChanged { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.EventCallback<System.DateTime[]> | An event callback function. |
ValuesExpression
Gets or sets the expression for defining the values of the bound.
Declaration
public Expression<Func<DateTime[]>> ValuesExpression { get; set; }
Property Value
Type | Description |
---|---|
System.Linq.Expressions.Expression<System.Func<System.DateTime[]>> | The expression for defining the values of the bound, represented as a lambda expression of type .
|
Methods
AddDatesAsync(DateTime[])
To adds the single or multiple dates to the Values property of the calendar.
Declaration
public Task AddDatesAsync(DateTime[] dates = null)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime[] | dates | Specifies the dates to be added to the Values property of the Calendar. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
ChangeEvent(EventArgs, Boolean)
Triggers when calendar value is changed.
Declaration
protected override void ChangeEvent(EventArgs args, bool isSelection = false)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | args | Specifies the event arguments. |
System.Boolean | isSelection | Determines whether selection is made using the mouse or keyboard. |
Overrides
CurrentView()
Gets the current view of the Calendar.
Declaration
public string CurrentView()
Returns
Type | Description |
---|---|
System.String | Current view of the calendar. |
GetPersistDataAsync()
Gets the properties to be maintained upon browser refresh.
Declaration
public Task<string> GetPersistDataAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | Task. |
NavigateAsync(CalendarView, TValue)
To navigate to the month or year or decade view of the calendar.
Declaration
public Task NavigateAsync(CalendarView view, TValue date)
Parameters
Type | Name | Description |
---|---|---|
CalendarView | view | Specifies the view of the calendar. |
TValue | date | Specifies the focused date in a view. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
OnAfterRenderAsync(Boolean)
Triggers after the component is rendered.
Declaration
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | firstRender | True if the component is rendered for the first time. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
Overrides
OnInitializedAsync()
Triggers while initial rendering of the component.
Declaration
protected override Task OnInitializedAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
Overrides
OnParametersSetAsync()
Triggers while dynamically changing the properties of the component.
Declaration
protected override Task OnParametersSetAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | Task. |
Overrides
RemoveDatesAsync(DateTime[])
To removes the single or multiple dates from the Values property of the calendar.
Specifies the dates which need to be removed from the values property of the Calendar.Declaration
public Task RemoveDatesAsync(DateTime[] dates = null)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime[] | dates |
Returns
Type |
---|
System.Threading.Tasks.Task |