Skip to main content
All docs
V25.1
  • DxDateEditSettings.MinDate Property

    Specifies the minimum date that can be selected in the date editor.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    [Parameter]
    public DateTime MinDate { get; set; }

    Property Value

    Type Description
    DateTime

    The minimum date.

    Remarks

    Use the MinDate and MaxDate properties to specify a range of available dates. Note that the maximum date should be greater than the minimum date; otherwise, an exception occurs. The date editor’s calendar disables dates that are out of the range and navigation arrows for them. If a user types a date that is out of the range, the date editor keeps the previously selected date.

    The default minimum and maximum values are DateTime.MinValue and DateTime.MaxValue.

    In the following code snippet, the hire date can be specified two weeks in advance and only for new employees.

    @inject EmployeeService EmployeeData
    
    <DxGrid @ref="grid" Data="@employees" PageSize="4" KeyFieldName="ID"
            EditMode="GridEditMode.EditRow" EditStart="OnEditStart">
        <Columns>
            <DxGridCommandColumn />
            <DxGridDataColumn FieldName="FirstName" />
            <DxGridDataColumn FieldName="LastName" />
            <DxGridDataColumn FieldName="BirthDate" />
            <DxGridDataColumn FieldName="HireDate" >
                <EditSettings>
                    <DxDateEditSettings MinDate="@DateTime.Today" 
                                        MaxDate="@DateTime.Today.AddDays(14)" />
                </EditSettings>
            </DxGridDataColumn>
            <DxGridDataColumn FieldName="Email" />
        </Columns>
    </DxGrid>
    
    @code {
        IGrid grid { get; set; }
        Employee[]? employees;
        protected override async Task OnInitializedAsync() {
            employees = await EmployeeData.GetData();
        }
        void OnEditStart(GridEditStartEventArgs e) {
            var settingsHireDate = grid.GetColumnEditSettings<IDateEditSettings>("HireDate");
            grid.BeginUpdate();
            // Allows users to edit the hire date for new employees only
            settingsHireDate.Enabled = e.IsNew;
            settingsHireDate.ShowDropDownButton = e.IsNew;
            grid.EndUpdate();
        }
    }
    

    Edit a Row

    Date Edit in Grid

    Create a Row

    Date Edit in Grid

    In scroll picker mode, the date editor shows a notification message each time a user tries to navigate to a date that is out of the range. To customize the notification text, use the OutOfRangeNotificationText property.

    To change the minimum date at runtime, use the IDateEditSettings.MinDate property instead.

    Implements

    See Also