ASP.NET Core MVC Controls | ComponentOne
Working with Controls / Input Controls / InputDateRange Overview / Display Modes
In This Topic
    Display Modes
    In This Topic

    InputDateRange control allows you to control its editability and state. This can be useful in the scenarios where you want limit the user from modifying the control value until some other conditions have been met, like selecting a radio button or a checkbox. Let us explore more about these modes in the following sections.

    Disabled Mode

    You can keep the InputDateRange control in deactivated state using the IsDisabled property. This allows you to inactivate the InputDateRange control and limit any modifications.

    To disable the InputDaterange control using the IsDisabled property, use the following code:

    Index.cshtml
    Copy Code
    @{
        var today = DateTime.Now.Date;
        var rangeEnd = today.AddDays(4);
    }
    
    <c1-input-date-range id="demoControl" value="@today" is-disabled="true" range-end="@rangeEnd">
    </c1-input-date-range>
    

    ReadOnly Mode

    InputDateRange provides the IsReadOnly property which lets you choose whether to allow the user to modify the control value with the mouse and keyboard at runtime. To make the InputDateRange control non-editable using the IsReadOnly property, use the following code:

    Index.cshtml
    Copy Code
    @{
        var today = DateTime.Now.Date;
        var rangeEnd = today.AddDays(4);
    }
    <c1-input-date-range id="demoControl" value="@today" is-read-only="true" range-end="@rangeEnd">
    </c1-input-date-range>