title: Retrieve all drop-down values from database and show the saved value as selected one in drop down
body: <p>I am using a kendo grid with pop up editing mode and editor template in mvc4. The template consists of a drop down list which is bound through database. The problem comes when in Edit operation all other data is retrieved along with all elements of drop down list and displayed in respective html attributes such a textbox ,checkbox etc but the value which i have saved from drop down list is not shown auto selected there.</p>
  
  <blockquote>
    <p>Example</p>
  </blockquote>
  
  <p>During add operation i have selected "Work" from the drop down list and saved it in database. At the time of Edit i want "Work" to be shown auto selected in drop down list. </p>
  
  <pre><code>[AcceptVerbs(HttpVerbs.Post)]
  public JsonResult Update([DataSourceRequest] DataSourceRequest request,Model object)
  {
     if (obj == null || !ModelState.IsValid) return null;
        var obj = _Repo.FindBy(t =&gt; t.ID == object.ID);
        obj.Text = object.Text;
        obj.Type = object.Type;
        obj.MasterTypeID_Fk = new Guid(object.Type);
        obj.Notes = object.Notes;
        obj.Primary = object.Primary;
        obj.LastVerified = DateTime.Now.ToUniversalTime();
        obj.LastUpdated = DateTime.Now.ToUniversalTime();
        _Repo.Update(obj);
        var result = new[] { object }.ToDataSourceResult(request, ModelState);
        return Json(result);
  }
  
  //this is my code for ddl in editor template
  
  @(Html.Kendo().DropDownList()
      .Name("Type")
      .DataTextField("Value")
      .DataValueField("TypeID")
      .DataSource(source =&gt;
      {
          source.Read(read =&gt; { read.Action("GetTypes", "Dashboard"); });
      })
  )
  
  // this is code in controller to bind ddl
  
  public ActionResult GetTypes()
  {
      List&lt;TypeModel&gt; Type = _Repo.GetTypes().ToList().ToMap&lt;TypeBO, TypeModel&gt;();
      Type.Insert(0, new TypeModel() { Value = "--Select--", TypeID = Guid.Empty });
      return Json(Type, JsonRequestBehavior.AllowGet);
  }
  </code></pre>