Hello,
I have DropDownList, his data are dynamicly loaded due to Project DropDownList. In DataBound event I want change to select first value by JavaScript. I use SetDefValuesO function for this. It works, when data are loaded in Operation list function automaticly select first item. But when i click to save in inline edit Grid Row, update request do not contain changed value. It works only when I do it by mouse click.
Grid code:
columns.Bound(work => work.Operation).ClientTemplate("#=Operation.Code#").Width(100);
.....
.Model(model =>
{
model.Id(p => p.Id);
model.Field(p => p.Operation).DefaultValue(ViewData["defaultOperation"] as TT.Web.Models.ViewModel.OperationViewModel);
model.Field(p => p.Spp).DefaultValue(ViewData["defaultSpp"] as TT.Web.Models.ViewModel.SppViewModel);
model.Field(p => p.Project).DefaultValue(ViewData["defaultProject"] as TT.Web.Models.ViewModel.ProjectViewModel);
})
Dropdown for Editor template :
function SetDefValuesO(){
var OperationCount = $("#Operation").data("kendoDropDownList").dataSource._data.length;
if(OperationCount == 1){
$("#Operation").data("kendoDropDownList").select(1);
}}
Value is selected correctly, but data which are send by clicking save in inlineEdit mode, do not containt selected value, but the default value defined in GRID model (first code sample).
Thnaks for Help !