alexa
menu

Blazor Toolkit

    Show / Hide Table of Contents

    Class SfCalendar<TValue>

    Represents the Syncfusion Blazor Calendar component, which provides a user-friendly interface for displaying and selecting dates on a Gregorian calendar.

    Inheritance
    System.Object
    SfBaseComponent
    SfInputBase<TValue>
    CalendarBase<TValue>
    SfCalendar<TValue>
    Implements
    System.IAsyncDisposable
    Inherited Members
    CalendarBase<TValue>.CalendarMode
    CalendarBase<TValue>.ConvertToGregorian(String, String)
    CalendarBase<TValue>.ConvertToHijri(TValue, String)
    CalendarBase<TValue>.DayHeaderFormat
    CalendarBase<TValue>.Depth
    CalendarBase<TValue>.FirstDayOfWeek
    CalendarBase<TValue>.KeyConfigs
    CalendarBase<TValue>.Max
    CalendarBase<TValue>.Min
    CalendarBase<TValue>.ShowTodayButton
    CalendarBase<TValue>.Start
    CalendarBase<TValue>.WeekNumber
    CalendarBase<TValue>.WeekRule
    SfBaseComponent.DisposeAsync()
    SfInputBase<TValue>.CssClass
    SfInputBase<TValue>.Disabled
    SfInputBase<TValue>.EnablePersistence
    SfInputBase<TValue>.ID
    SfInputBase<TValue>.ValidateOnInput
    SfInputBase<TValue>.Value
    SfInputBase<TValue>.ValueChanged
    Syncfusion.Blazor.Toolkit.Calendars.CalendarBase<TValue>.CalendarEditContext
    Syncfusion.Blazor.Toolkit.Calendars.CalendarBase<TValue>.ChangeEvent(System.EventArgs, System.Boolean)
    Syncfusion.Blazor.Toolkit.Calendars.CalendarBase<TValue>.ConvertDateValue(TValue)
    Syncfusion.Blazor.Toolkit.Calendars.CalendarBase<TValue>.CurrentCulture
    Syncfusion.Blazor.Toolkit.Calendars.CalendarBase<TValue>.DisposeAsyncCore()
    Syncfusion.Blazor.Toolkit.Calendars.CalendarBase<TValue>.GetHijriMonthIndex(System.String, System.String)
    Syncfusion.Blazor.Toolkit.Calendars.CalendarBase<TValue>.IsDateOnlyType()
    Syncfusion.Blazor.Toolkit.Calendars.CalendarBase<TValue>.IsDateTimeOffsetType()
    Syncfusion.Blazor.Toolkit.Calendars.CalendarBase<TValue>.ReplaceMonthName(System.String, System.DateTime, System.String[], System.String)
    Syncfusion.Blazor.Toolkit.Calendars.CalendarBase<TValue>.SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView)
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.APPEND
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.APPENDICON
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.ARIADISABLED
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.BaseAutocomplete
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.BaseFloatLabelType
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.BaseHtmlAttributes
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.BaseInputAttributes
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.BaseIsReadOnlyInput
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.BasePlaceholder
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.BaseReadOnly
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.BaseShowClearButton
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.BaseTabIndex
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.BaseWidth
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.BlurHandlerAsync(System.String, System.Boolean)
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.ChangeHandlerAsync(Microsoft.AspNetCore.Components.ChangeEventArgs)
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.ChildContent
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.CLEARICON
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.CLEARICONHIDE
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.ClickStopPropagation
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.ComponentReference
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.ContainerAttributes
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.ContainerClass
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.ContainerHtmlAttributes
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.CONTROLCONTAINER
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.CONTROLOLDCONTAINER
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.DataId
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.DECREMENT
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.DECREMENTHEADING
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.DecrementTitle
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.DISABLE
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.DISABLEDATTRIBUTE
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.DISABLEICON
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.FLOATINPUT
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.FloatLabel
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.FLOATLABELBOTTOM
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.FLOATLABELTOP
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.FLOATTEXT
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.FocusHandlerAsync(Microsoft.AspNetCore.Components.Web.FocusEventArgs)
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.FocusOutHandlerAsync(Microsoft.AspNetCore.Components.Web.FocusEventArgs)
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.FormatValue(System.String)
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.FormatValueAsString(TValue)
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.GROUPICON
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.INCREMENT
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.INCREMENTHEADING
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.IncrementTitle
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.INPUT
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.INPUTBASECLASS
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.InputEditContext
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.INPUTFOCUS
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.INPUTGROUP
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.InputHandlerAsync(Microsoft.AspNetCore.Components.ChangeEventArgs)
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.InputHtmlAttributes
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.IsBindInputEvent
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.IsClearButtonClicked
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.IsFocused
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.IsValueTemplate
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.ListOfButtons
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.MouseDownSpinnerPrevent
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.MULTILINE
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.MultilineInput
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.OnAfterRenderAsync(System.Boolean)
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.OnChange
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.OnChangeHandlerAsync(Microsoft.AspNetCore.Components.ChangeEventArgs)
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.OnInitializedAsync()
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.OnInputHandlerAsync(Microsoft.AspNetCore.Components.ChangeEventArgs)
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.OnParametersSetAsync()
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.OnPaste
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.OnPasteHandlerAsync(Microsoft.AspNetCore.Components.Web.ClipboardEventArgs)
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.PREPEND
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.PREPENDICON
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.PreventIconHandler
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.RootClass
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.SetEnabled()
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.SPACE
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.SpinButton
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.SPINDOWN
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.SPINUP
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.ValueExpression
    Syncfusion.Blazor.Toolkit.Inputs.SfInputBase<TValue>.WireClearBtnEventsAsync()
    Namespace: Syncfusion.Blazor.Toolkit.Calendars
    Assembly: Syncfusion.Blazor.Toolkit.dll
    Syntax
    public class SfCalendar<TValue> : CalendarBase<TValue>, IAsyncDisposable
    Type Parameters
    Name
    TValue
    Remarks

    The SfCalendar<TValue> component allows users to navigate through months and years, select single or multiple dates, and customize the display with templates and styles. It supports localization, RTL, and various accessibility features. For advanced scenarios, the component raises events to handle value changes, cell rendering, and navigation actions.

    This component is commonly used for inputting or displaying dates inline, either standalone or as part of a larger form.

    Examples

    The following example demonstrates how to declare and use the SfCalendar<TValue> component in a Razor file:

    <SfCalendar TValue="DateTime" @bind-Value="SelectedDate"></SfCalendar>
    @code {
        private DateTime? SelectedDate = DateTime.Today;
    }

    Example of using SfCalendar component with multi-date selection enabled:

    <SfCalendar TValue="DateTime" IsMultiSelection="true" @bind-Values="SelectedDates"></SfCalendar>

    Here is an example of rendering an SfCalendar in a Blazor component:

    <SfCalendar TValue="DateTime" />

    Constructors

    SfCalendar()

    Declaration
    public SfCalendar()

    Properties

    Created

    Gets or sets an event callback that is invoked when the calendar component is created and initialized.

    Declaration
    public EventCallback<object> Created { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An Microsoft.AspNetCore.Components.EventCallback<> of type object that is triggered after the component is created and fully initialized. The callback receives an object containing creation details.

    Remarks

    This event is useful for executing code after the calendar's resources have been fully allocated and rendered.

    Examples
    <SfCalendar TValue="DateTime?" Created="@OnCreated">
    </SfCalendar>
    @code {
        private void OnCreated(object args) {
            Console.WriteLine("Calendar created.");
        }
    }

    DayCellRendering

    Gets or sets an event callback that is invoked as each calendar day cell is rendered.

    Declaration
    public EventCallback<RenderDayCellEventArgs> DayCellRendering { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<RenderDayCellEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that is triggered when a day cell is rendered in the calendar. The callback receives a RenderDayCellEventArgs providing details for customizing the cell appearance.

    Remarks

    This event allows customizing the visual appearance or properties of individual day cells as they are rendered in the calendar UI.

    Examples
    <SfCalendar TValue="DateTime?" DayCellRendering="@CellRendered">
    </SfCalendar>
    @code {
        private void CellRendered(RenderDayCellEventArgs args) {
            args.CellData.ClassList = "e-custom-style";
        }
    }

    DeSelected

    Gets or sets an event callback that is invoked after deselecting a value in the calendar.

    Declaration
    public EventCallback<DeSelectedEventArgs<TValue>> DeSelected { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<DeSelectedEventArgs<TValue>>

    An Microsoft.AspNetCore.Components.EventCallback<> that is invoked when a value is deselected. The callback receives a DeSelectedEventArgs<T> instance providing details of the deselected date.

    Remarks

    This event is only triggered when the IsMultiSelection property is enabled, allowing multiple date selection and deselection in the calendar.

    Examples
    <SfCalendar TValue="DateTime?" IsMultiSelection="true" DeSelected="@ValueDeselected">
    </SfCalendar>
    @code {
        private void ValueDeselected(DeSelectedEventArgs<DateTime?> args) {
            Console.WriteLine($"Deselected value: {args.Value}");
        }
    }

    Destroyed

    Gets or sets an event callback that is invoked when the calendar component is disposed and destroyed.

    Declaration
    public EventCallback<object> Destroyed { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.Object>

    An Microsoft.AspNetCore.Components.EventCallback<> of type object that is triggered during component disposal. The callback receives an object providing destruction context.

    Remarks

    Use this event to perform cleanup or release resources associated with the calendar when it is destroyed.

    Examples
    <SfCalendar TValue="DateTime?" Destroyed="@OnDestroyed">
    </SfCalendar>
    @code {
        private void OnDestroyed(object args) {
            Console.WriteLine("Calendar destroyed.");
        }
    }

    HtmlAttributes

    Gets or sets a collection of additional HTML attributes such as styles, CSS classes, and other custom settings to be applied to the calendar's root element.

    Declaration
    public Dictionary<string, object> HtmlAttributes { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Object>

    A System.Collections.Generic.Dictionary<, > of string and object pairs. The default is null.

    Remarks

    Use this property to attach custom styles, attributes, or data-* attributes to the calendar component for advanced customization and integration scenarios.

    Examples

    Add custom classes and styles to the calendar:

    <SfCalendar TValue="DateTime" HtmlAttributes="@new Dictionary<string, object>{{ "class", "custom-calendar" }, { "data-type", "events" }}"></SfCalendar>

    IsMultiSelection

    Gets or sets a value that indicates whether the calendar allows selection of multiple dates concurrently.

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

    true to enable multiple date selection; otherwise, false. The default value is false.

    Remarks

    When set to true, the user can select multiple non-contiguous dates within the calendar. When false, single date selection mode applies.

    Examples

    Enable multiple date selection on the calendar:

    <SfCalendar TValue="DateTime" IsMultiSelection="true" @bind-Values="SelectedDates"></SfCalendar>

    Navigated

    Gets or sets an event callback that is invoked after the calendar is navigated to another level or within the same level of the calendar view.

    Declaration
    public EventCallback<NavigatedEventArgs> Navigated { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<NavigatedEventArgs>

    An Microsoft.AspNetCore.Components.EventCallback<> that is triggered after navigation in the calendar. The callback receives a NavigatedEventArgs instance describing the navigation context.

    Remarks

    Use this event to track and respond to changes in the calendar's current view, such as when switching between months, years, or decades.

    Examples
    <SfCalendar TValue="DateTime?" Navigated="@ViewNavigated">
    </SfCalendar>
    @code {
        private void ViewNavigated(NavigatedEventArgs args) {
            Console.WriteLine($"Current view: {args.View}");
        }
    }

    Selected

    Gets or sets an event callback that is invoked after one or more date values are selected in the calendar.

    Declaration
    public EventCallback<SelectedEventArgs<TValue>> Selected { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<SelectedEventArgs<TValue>>

    An Microsoft.AspNetCore.Components.EventCallback<> that is invoked when dates are selected. The callback receives a SelectedEventArgs<T> instance containing the information about the selected value(s).

    Remarks

    This event is raised after a date or multiple dates are selected by the user via the calendar UI or through code.

    Examples
    <SfCalendar TValue="DateTime?" Selected="@ValueSelected">
    </SfCalendar>
    @code {
        private void ValueSelected(SelectedEventArgs<DateTime?> args) {
            Console.WriteLine($"Selected value: {args.Value}");
        }
    }

    TabIndex

    Gets or sets the tab index which determines the tab order for the component in the page.

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

    An int representing the tab index. The default is 0.

    Remarks

    This value controls the order in which focus shifts when the user presses the Tab key.

    Examples

    Set a custom tab index for accessibility:

    <SfCalendar TValue="DateTime" TabIndex="2"></SfCalendar>

    ValueChange

    Gets or sets an event callback that is invoked when the Values property changes.

    Declaration
    public EventCallback<ChangedEventArgs<TValue>> ValueChange { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<ChangedEventArgs<TValue>>

    An Microsoft.AspNetCore.Components.EventCallback<> that is triggered when the calendar values are changed. The callback receives an instance of ChangedEventArgs<T> containing the new value and other details.

    Remarks

    Use this event to respond to changes in the selected dates when interacting with the calendar, such as via UI input or programmatic assignment.

    Examples
    <SfCalendar TValue="DateTime?" ValueChange="@ValueChange">
    </SfCalendar>
    @code {
        private void ValueChange(ChangedEventArgs<DateTime?> args) {
            Console.WriteLine($"Changed value: {args.Value}");
        }
    }

    Values

    Gets or sets an array of System.DateTime values representing the selected dates in the calendar.

    Declaration
    public DateTime[] Values { get; set; }
    Property Value
    Type Description
    System.DateTime[]

    An array of System.DateTime objects that indicate the currently selected dates.

    Remarks

    This can be used for binding multiple selected dates in multi-selection mode. Binding this property will update the calendar with the selected values.

    Examples

    Bind selected date values from a model:

    <SfCalendar TValue="DateTime" @bind-Values="MySelectedDates"></SfCalendar>

    ValuesChanged

    Gets or sets the event callback that is triggered when the Values property changes.

    Declaration
    public EventCallback<DateTime[]> ValuesChanged { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Components.EventCallback<System.DateTime[]>

    An Microsoft.AspNetCore.Components.EventCallback<> of type DateTime[] invoked when the selected dates are updated by the user.

    Remarks

    This event can be used to perform additional actions or synchronize state when the collection of selected dates changes.

    Examples

    Subscribe to value change events in code:

    <SfCalendar TValue="DateTime" @bind-Values="SelectedDates" ValuesChanged="OnValuesChanged"></SfCalendar>
    @code {
        private void OnValuesChanged(DateTime[] newValues) {
            // Handle the changed dates
        }
    }

    ValuesExpression

    Gets or sets the System.Linq.Expressions.Expression used to bind multiple values to the calendar in two-way binding scenarios.

    Declaration
    public Expression<Func<DateTime[]>> ValuesExpression { get; set; }
    Property Value
    Type Description
    System.Linq.Expressions.Expression<System.Func<System.DateTime[]>>

    An expression of lambda type Expression<Func<DateTime[]>> for advanced data binding scenarios, especially in forms or custom validation.

    Remarks

    Typically used internally for validation and model binding when implementing complex forms with multiple selected dates.

    Examples

    Example usage inside a form for complex model binding:

    <EditForm Model="MyModel">
        <SfCalendar TValue="DateTime"
            ValuesExpression="@(() => MyModel.SelectedDates)"
            @bind-Values="MyModel.SelectedDates">
        </SfCalendar>
    </EditForm>

    Methods

    AddDatesAsync(DateTime[])

    Adds one or more dates to the Values selection when the calendar is in multi-selection mode.

    Declaration
    public Task AddDatesAsync(DateTime[] dates = null)
    Parameters
    Type Name Description
    System.DateTime[] dates

    An array of System.DateTime objects to be added to the calendar's selection. If null or empty, the method does nothing.

    Returns
    Type Description
    System.Threading.Tasks.Task

    A task representing the asynchronous add operation.

    Remarks

    This method updates the selected dates only when IsMultiSelection is set to true. It does not allow duplicates in the selection. If a date is already selected, it will not be added again.

    Examples
    await calendar.AddDatesAsync(new DateTime[] { new DateTime(2022,2,12), new DateTime(2022,2,14) });

    BuildRenderTree(RenderTreeBuilder)

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

    CurrentView()

    Returns the current view in which the calendar is displayed (such as Month, Year, or Decade).

    Declaration
    public string CurrentView()
    Returns
    Type Description
    System.String

    A string that represents the current calendar view. Can be "Month", "Year", or "Decade".

    Remarks

    Use this method to check which logical view is currently shown to the user. Typical use is in UI customization or conditionally showing controls based on calendar state.

    Examples
    var view = calendar.CurrentView();

    GetPersistDataAsync()

    Retrieves the data to be persisted for this calendar instance upon browser refresh or reload.

    Declaration
    public Task<string> GetPersistDataAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task<System.String>

    A task representing the asynchronous operation. The task result contains a string with the persisted state for the calendar instance.

    Remarks

    Use this method to fetch stateful data such as selected values from browser storage for the current SfCalendar<TValue> instance using its unique identifier.

    Examples
    var persistData = await calendar.GetPersistDataAsync();

    NavigateAsync(CalendarView, TValue)

    Navigates the calendar programmatically to a specified logical view and date.

    Declaration
    public Task NavigateAsync(CalendarView view, TValue date)
    Parameters
    Type Name Description
    CalendarView view

    Specifies the target logical view of the calendar. Use CalendarView enum values: Month, Year, or Decade.

    TValue date

    The date to focus in the new view, of type TValue (typically DateTime).

    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing the asynchronous navigation operation.

    Remarks

    Use this method for scenarios that require calendar navigation at runtime, automating view changes for guided workflows or conditional behaviors based on user actions or events.

    Examples
    await calendar.NavigateAsync(CalendarView.Year, DateTime.Now);

    RemoveDatesAsync(DateTime[])

    Removes one or more dates from the Values selection when the calendar is in multi-selection mode.

    Declaration
    public Task RemoveDatesAsync(DateTime[] dates = null)
    Parameters
    Type Name Description
    System.DateTime[] dates

    An array of System.DateTime objects specifying which dates to remove from the current selection. If null or empty, no dates are removed.

    Returns
    Type Description
    System.Threading.Tasks.Task

    A System.Threading.Tasks.Task representing the asynchronous remove operation.

    Remarks

    This method updates the selected dates only if IsMultiSelection is true and selected Values are not empty.

    Examples
    await calendar.RemoveDatesAsync(new DateTime[] { new DateTime(2022,2,12) });

    Implements

    System.IAsyncDisposable
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved