title: Kendo Cascade DropDownList MVC - set value
body: <p>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 <code>SetDefValuesO</code> 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.</p>
  
  <p>How to solve this ? Thanks!</p>
  
  <p>Grid:</p>
  
  <pre><code>   columns.Bound(work =&gt; work.Operation).ClientTemplate("#=Operation.Code#").Width(100);
  .Model(model =&gt;
   {
      model.Id(p =&gt; p.Id);
      model.Field(p =&gt; p.Operation).DefaultValue(ViewData["defaultOperation"] as TT.Web.Models.ViewModel.OperationViewModel);
      model.Field(p =&gt; p.Spp).DefaultValue(ViewData["defaultSpp"] as TT.Web.Models.ViewModel.SppViewModel);
      model.Field(p =&gt; p.Project).DefaultValue(ViewData["defaultProject"] as TT.Web.Models.ViewModel.ProjectViewModel);
  })
  </code></pre>
  
  <p>Editor template:</p>
  
  <pre><code>@(Html.Kendo().DropDownList()
      .Name("Operation")
      .OptionLabel("Vyberte výkon...")
      .CascadeFrom("Project")
      .DataValueField("Id")
      .Events(ev =&gt; ev.DataBound("SetDefValuesO") )
      .HtmlAttributes( new { requiredvalidationmessage = "required field", required = "required" })
      .DataTextField("Code")
                        .DataSource(source =&gt;
                        {
  
                            source.Read(read =&gt;
                            {
                                read.Action("GetCascadeOperations", "Home")
                                      .Data("filterOperations");
                            }).ServerFiltering(true); 
                        })
                        .Enable(false)
                        .AutoBind(false))
  
  
  function SetDefValuesO(){
  
  var OperationCount = $("#Operation").data("kendoDropDownList").dataSource._data.length;
  console.log(OperationCount);
  
  if(OperationCount == 1){
      $("#Operation").data("kendoDropDownList").value($("#Operation").data("kendoDropDownList").dataSource._data[0].Id);
      console.log($("#Operation").val());
  }
  </code></pre>
  
  <p>SOLVED BY:</p>
  
  <pre><code>    function SetDefValuesO(){
      var OperationCount = $("#Operation").data("kendoDropDownList").dataSource._data.length;
      if(OperationCount == 1){
         // $("#Operation").data("kendoDropDownList").select(1);
          $("#Operation").data("kendoDropDownList").value($("#Operation").data("kendoDropDownList").dataSource._data[0].Id);
          this.trigger("change"); // solution
      }
  }
  </code></pre>