This question is locked. New answers and comments are not allowed.
I found much topics about this problem and no good solution.
Edit grid in popup mode.
Questions:
1. How to set selected value equal to model properties on DropDownList?
2. How to retrieve selected value and bond to model properties when i want to save edited record?
What i have now is:
Part of my Editor Template
Edit grid in popup mode.
Questions:
1. How to set selected value equal to model properties on DropDownList?
2. How to retrieve selected value and bond to model properties when i want to save edited record?
What i have now is:
Part of my Editor Template
@Html.LabelFor(model => model.RoleName)
@Html.DropDownListFor(model => model.RoleName,
new SelectList(ViewBag.Roles, "RoleId", "RoleName", Model.RoleName))
DropDown list is filled correctly, but how to set selected Value equal to model properties?
I tried:
@Html.Telerik().DropDownListFor(model => model.RoleName).Name(
"ddlRoles").BindTo(new SelectList(ViewBag.Roles, "RoleId", "RoleName", (List<PoCo.Role>)ViewBag.Roles).Find(delegate(PoCo.Role item) { return item.RoleId == Model.RoleId; })).RoleId))
and mutation of this, no one works. Never my value is not selected.
Next - i totally dont know how to retrieve value after i save.
Thanks for help