DropDownList Cannot Preselect the Drop-Down ID of the Current Grid Row
|Product||Progress® Telerik® UI Grid for UI for ASP.NET Core|
I cannot get the DropDownList to preselect the drop-down ID of the current row. How can I bind it to the column value when the Grid for ASP.NET Core is in edit mode?
Steps to Reproduce
This is a logged issue. The Core helpers duplicate the property name when the
Name() declarations are used. For more information, refer to this issue.
Telerik UI for ASP.NET Core does not provide a built-in solution for achieving this behavior. However, you can still workaround the issue by using a
.DropDownListFor(m => m) definition when defining an Editor Template.
@model Project.Models.StateProvinceRegionViewModel @(Html.Kendo().DropDownListFor(m => m) .DataValueField("Id") .DataTextField("Name") .DataSource(d => d .Read(r => r.Action("GetStateProvinceRegions", "Admin")) ) )
For further details on configuring Custom Editors for the Grid refer to the Custom Editing section of the documentation and the runnable example demonstrating the use of a DropDownList as a Custom Editor
More ASP.NET Core Grid Resources
Telerik UI for ASP.NET Core Video Onboarding Course (Free for trial users and license holders)