How to get a selected Date Picker value?

Hallow,

I have a date picker in a data grid column, like

after I picked up a date time, how can I got the picked date time value. I want to use the picked date time value in other place.

the codes are:

            <RadzenDataGridColumn TItem="Wmds.Models.Wmdsui.TaskScheduleDto" FormatString="{0:g}" Property="ModifiedDate" SortOrder="SortOrder.Descending" TextAlign="TextAlign.Center" Title="Modified Date" Width="200px" Filterable="true" FilterProperty="ModifiedDate">
            </RadzenDataGridColumn>

Thank you!

John

Hi @jzhu,

This DatePicker will set the respective DataGrid column FilterValue property. If you have set @ref for the DataGrid, you can access it like this for example: grid.ColumnsCollection[3].FilterValue. Since the value of this property is object you can cast it to DateTime when needed.

Thank you for help!
I have another question: when I click the datepicker and make a selection, do I have a way to call a function and pass the parameters to the function in the xxx.razor.cs file?
Thank you again!
John

You can use LoadData event if you want to get new data according to the new filter - check our demos for reference.

Thank you, Enchev,
I only want to call a function that is created in xxx.razor.cs,
the code in razor:

RadzenDataGridColumn
TItem="Wmds.Models.Wmdsui.TaskScheduleDto" FormatString="
{0:g}" Property="ModifiedDate" SortOrder="SortOrder.Descending"
TextAlign="TextAlign.Center" Title="Modified Date" Width="200px"
Filterable="true" FilterProperty="ModifiedDate" >
</RadzenDataGridColumn

I have a function in xxx.razor.cs,
protected async System.Threading.Tasks.Task OnModifiedDateSelectionAsync(object value)
{
// DateTime dt = value.
}

how to call this function from razor RadzenDataGridColumn.
I don't need to reload datagrid,

thank you!
John

There is another Filter event that can be used for such functions calls.