Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxDateRangePicker<T>.EndDateExpression Property

Specifies a lambda expression that identifies the EndDate property’s bound value when the Date Range Picker is placed in the EditForm.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public Expression<Func<T>> EndDateExpression { get; set; }

#Property Value

Type Description
Expression<Func<T>>

A lambda expression that identifies the bound value.

#Remarks

You can add a Date Range Picker to Blazor’s standard EditForm component to validate StartDate and EndDate property values. In this case, StartDateExpression and EndDateExpression properties are used to obtain metadata about the value bound to StartDate and EndDate properties.

You should specify StartDateExpression and EndDateExpression properties if you handle StartDateChanged and EndDateChanged events and cannot use two-way binding.

Razor
<DxDateRangePicker StartDate="@modelStartDate" 
                   EndDate="@modelEndDate"
                   StartDateExpression="@(() => modelStartDate)"
                   EndDateExpression="@(() => modelEndDate)"
                   StartDateChanged="@((DateTime newStartDate) => OnStartDateChanged(newStartDate))"
                   EndDateChanged="@((DateTime newEndDate)=> OnEndDateChanged(newEndDate))" />

@code {
    DateTime modelStartDate = DateTime.Today;
    DateTime modelEndDate = DateTime.Today.AddDays(7);

    void OnStartDateChanged(DateTime newStartDate) {
        modelStartDate = newStartDate;
        // your logic
    }

    void OnEndDateChanged(DateTime newEndDate) {
        modelEndDate = newEndDate;
        // your logic
    }
}

StartDateExpression and EndDateExpression properties are set internally if you use the @bind attribute for StartDate and EndDate properties to implement two-way binding.

Razor
<DxDateRangePicker @bind-StartDate="@DateTimeStart"
                   @bind-EndDate="@DateTimeEnd">
</DxDateRangePicker>

@code {
    DateTime? DateTimeStart { get; set; } = DateTime.Today;
    DateTime? DateTimeEnd { get; set; } = DateTime.Today.AddDays(7);

    ...
}
See Also