Disable the Blazor DateRangePicker Component

28 Feb 20221 minute to read

DateRangePicker can be deactivated on a page. Setting Enabled value to false will disable the component completely from all user interactions, including form post. The following code demonstrates the disabled component.

@using Syncfusion.Blazor.Calendars

<SfDateRangePicker TValue="DateTime?" Enabled=false StartDate="@Start" EndDate="@End"></SfDateRangePicker>

@code {
    public DateTime? Start { get; set; } = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 20);
    public DateTime? End { get; set; } = new DateTime(DateTime.Now.Year, DateTime.Now.Month + 1, 25);
}

Disable State in Blazor DateRangePicker

You can refer to our Blazor Date Range Picker feature tour page for its groundbreaking feature representations. You can also explore our Blazor Date Range Picker example to understand how to present and manipulate data.