RadzenDropDown Set Default Value

Hi,

I am using a dropdown inside of a data grid. I wonder if I can set Order Opened as the default value? (After the status selection, I am saving into the database.)

Thank you.

...
<RadzenDataGridColumn TItem="OrderDetail" Property="Status" Title="Status" OrderIndex="18">
                                <EditTemplate Context="orderDetail">
                                    <RadzenDropDown AllowClear="true" TValue="string" Class="w-100" Data=@detailStatusList @bind-Value="orderDetail.Status" Name="Status" Change=@(args => OnChange(args, order.Id)) />
                                    <RadzenRequiredValidator Text="Status is Required!" Component="Status" Popup="true" Style="position: absolute; z-index: 9999;"/>
                                </EditTemplate>
                            </RadzenDataGridColumn>
...
readonly List<string> detailStatusList = new() { "Order Opened", "China Warehouse", "Shipped", "At Custom", "Warehouse", "Completed" };

If your case is similar to our demo and you need default value for a property on insert you can simply add it when the new instance is created:

Thank you, I set it to default when inserting. Can I also display the default value on the dropdown?

If the bound value can found in the list assigned to Data the item will be automatically selected.

1 Like

thank you for your support @enchev