asp.net - MVC - Kendo Grid and DropDownList -
in editortemplates have defined dropdownlist as
@model int? @(html.kendo().dropdownlistfor(m => m) .name("id_sifra") .datavaluefield("id_sifra") .datatextfield("naziv") .datasource(datasource => datasource.read("read_sifredl","documents").serverfiltering(true) ) .htmlattributes(new { style = "width:400px" }) .optionlabel("---select---") )
in grid have
columns.bound(c => c.id_sifra).editortemplatename("_sifreeditor").title("id_sifra");
the read_sifredl in documentscontrollers is
public jsonresult read_sifredl() { var sifre = db.sifre.select(c => new { id_sifra = c.id, naziv = c.naziv }).tolist(); return json(sifre, jsonrequestbehavior.allowget); }
the problem when selection in dropdownlist (in case naziv), , dropdownlist has closed valuefield shown (in case id_sifra). want naziv shown. wrong in approach?
add naziv
in model and,
columns.bound(c => c.id_sifra).editortemplatename("_sifreeditor").title("naziv").clienttemplate("#:naziv#");;
Comments
Post a Comment