Radzen Date Picker how to set current date when adding new row?

Hello there,

I am using a data grid and when I add a new row I want to display the current date on the date picker. Is there a way to do it?


 <RadzenDataGridColumn TItem="Order" Property="OrderDateTime" Title="Order Date" Width="200px">
            <Template Context="order">
            <EditTemplate Context="order">
                <RadzenDatePicker @bind-Value="order.OrderDateTime" DateFormat="dd/MM/yyyy HH:mm" Class="w-100"/>

You can simply set DateTime.Now to this property when creating the new instance on Add button click.

1 Like