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>.StartDateChanged Event

Fires after a user changes the start date in the Date Range Picker.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public EventCallback<T> StartDateChanged { get; set; }

#Parameters

Type Description
T

A delegate method that accepts the start date value as a parameter.

#Remarks

The StartDateChanged event allows you to handle changes to the component’s start date.

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

@code {
    DateTime modelStartDate=DateTime.Today;
    DateTime modelEndDate = DateTime.Today.AddDays(7);
    string Alert_StartDate { get; set; }
    string Alert_EndDate { get; set; }

    void OnStartDateChanged(DateTime newStartDate) {
        modelStartDate = newStartDate;
        Alert_StartDate = "The start date changed:" + newStartDate;
    }

    void OnEndDateChanged(DateTime newEndDate) {
        modelEndDate = newEndDate;
        Alert_EndDate = "The end date changed:" + newEndDate;
    }
}

The StartDateChanged event is handled automatically when you use two-way data binding for the StartDate property (@bind-StartDate).

See Also