Back to Devexpress

DxDateRangePicker<T>.StartDateChanged Event

blazor-devexpress-dot-blazor-dot-dxdaterangepicker-1-a744d5c1.md

latest2.0 KB
Original Source

DxDateRangePicker<T>.StartDateChanged Event

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

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

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

Parameters

TypeDescription
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

DxDateRangePicker<T> Class

DxDateRangePicker<T> Members

DevExpress.Blazor Namespace