Edit this page

DropDownList Cannot Preselect the Drop-Down ID of the Current Grid Row

Environment

Product Progress Kendo UI Grid for ASP.NET Core
Kendo Version 217.2.621

Description 

I cannot get the DropDownList to preselect the dropdown 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 wrappers duplicate the property name when the DropDownList() and Name() declarations are used. For more information, refer to this issue.

Suggested Workarounds

Kendo UI does not provide a built-in solution for achieving this behavior. However, you can still work around the issue by using a .DropDownListFor(m => m) definition.

@model Project.Models.StateProvinceRegionViewModel

@(Html.Kendo().DropDownListFor(m => m)
    .DataValueField("Id")
    .DataTextField("Name")
    .DataSource(d => d
        .Read(r => r.Action("GetStateProvinceRegions", "Admin"))
    )
)
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy