title: Kendo Grid - ASP MVC is not displaying the drop down list
body: <p>I'm developing a project with ASP MVC 5, Kendo UI, and some layers, but I'm struggling with how to display the <strong>drop-down list</strong> inside of an <strong>editable Grid</strong>, I followed this example:</p>
  <p><a href="http://demos.telerik.com/aspnet-mvc/grid/editing-custom" rel="nofollow noreferrer">Grid Editing / custom editor</a></p>
  <p>However, I'm having serious issues because the drop-down list never <em>appears</em>, it's displaying two text boxes.</p>
  <p><a href="http://demos.telerik.com/aspnet-mvc/grid/editing-custom" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sh6pc.png" alt="example" /></a></p>
  <p>Also, if I run the <strong>Foreign Key column</strong> example:</p>
  <p><a href="http://demos.telerik.com/kendo-ui/grid/foreignkeycolumn" rel="nofollow noreferrer">Grid / ForeignKey column</a></p>
  <p>I have a different result with a numeric up-down:</p>
  <p><a href="https://i.stack.imgur.com/PO5bf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PO5bf.png" alt="Example 2" /></a></p>
  <p>Besides, I tested this example from StackOverflow and the result is either two textboxes or the numeric up-down (it depends if I bound the column or I use the foreign key column):</p>
  <p><a href="https://stackoverflow.com/questions/25365961/dropdownlist-in-kendo-grid-not-working">dropdownlist in kendo grid not working</a></p>
  <p>This is my code, in the <strong>Business Layer</strong>, I have these classes in order to return the Categories from the database:</p>
  <pre><code>using Test.DB.Operations;
  using System.Collections.Generic;
  using System.Linq;
  
  namespace Test.Business
  {
      public class Category
      {
          public int ID { get; set; }
          public string Name { get; set; }
      }
  
      public class CategoryData
      {
          public static List&lt;Category&gt; GetCategories()
          {
              var catData = DatabaseService.GetEntities&lt;DB.Category&gt;().ToList();
  
              return (from cData in catData select new Category() { ID = cData.ID, Name = cData.Name }).ToList();
          }
      }
  }
  </code></pre>
  <p>Later, in my <strong>MVC Layer</strong>, the <strong>Controller</strong> populates the view with some methods like these ones:</p>
  <pre><code>using Kendo.Mvc.Extensions;
  using Kendo.Mvc.UI;
  using Test.Business;
  using Test.Classes;
  using Test.MVC.Classes;
  using Test.MVC.Models;
  using System;
  using System.Collections.Generic;
  using System.Web.Mvc;
  
  namespace Test.MVC.Controllers
  {
      public class OrganizationDetailsController : Controller
      {
          public ActionResult Index(string ID)
          {
              PopulateCategories();
  
              if (!string.IsNullOrEmpty(ID))
              {
                  var model = new OrganizationsModel();
                  try
                  {
                      model.hasError = false;
                      model.messageBox = null;
                  }
                  catch (Exception ex)
                  {
                      model.hasError = true;
                      model.messageBox = new Tuple&lt;string, string&gt;(&quot;Error&quot;, &quot;Please report it to the team&quot;);
                  }
                  return View(model);
              }
              else
              {
                  return View();
              }
          }    
  
          public ActionResult OrganizationDetails_Read([DataSourceRequest]DataSourceRequest request, string ID)
          {
              try
              {
                  var data = OrganizationDetailsData.GetOrganizationDetails(ID);
                  DataSourceResult result = data.ToDataSourceResult(request);
                  return Json(result);
              }
              catch (Exception ex)
              {
                  return null;
              }
          }
  
          [AcceptVerbs(HttpVerbs.Post)]
          public ActionResult OrganizationDetails_Update([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = &quot;models&quot;)]&lt;OrganizationDetails&gt; oDetails)
          {
              return null;
          }
  
          [AcceptVerbs(HttpVerbs.Post)]
          public ActionResult OrganizationDetails_Create([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = &quot;models&quot;)]IEnumerable&lt;OrganizationDetails&gt; oDetails)
          {
              return null;
          }
  
          private void PopulateCategories()
          {
              var dataContext = CategoryData.GetCategories();
  
              ViewData[&quot;categories&quot;] = dataContext;
              ViewData[&quot;defaultCategory&quot;] = dataContext[0];
          }
      }
  }
  </code></pre>
  <p>The <strong>Model</strong> looks like this:</p>
  <pre><code>using Test.Business;
  using System;
  using System.Collections.Generic;
  using System.ComponentModel.DataAnnotations;
  
  namespace Test.MVC.Models
  {
      public class OrganizationsModel
      {
          public Tuple&lt;string, string&gt; messageBox;
          public bool hasError;
      }
  }
  </code></pre>
  <p>Finally, in the <strong>View</strong>, I have this code for the Kendo Grid:</p>
  <pre><code>@(Html.Kendo().Grid&lt;Test.Business.OrganizationDetails&gt;()
      .Name(&quot;gridDetails&quot;)
      .Columns(columns =&gt;
      {
          columns.Bound(b =&gt; b.Name);
          columns.Bound(b =&gt; b.NumberOfEmployees);
          //columns.ForeignKey(p =&gt; p.CategoryID, (System.Collections.IEnumerable)ViewData[&quot;categories&quot;], &quot;ID&quot;, &quot;Name&quot;).Title(&quot;Categories&quot;).EditorTemplateName(&quot;dropdownTemplate&quot;);
          columns.Bound(b =&gt; b.Category).ClientTemplate(&quot;#=Category.Name#&quot;);
          columns.Bound(p =&gt; p.Telephone);
          columns.Bound(p =&gt; p.Address);
      })
      .ToolBar(toolBar =&gt;
      {
          toolBar.Create();
          toolBar.Save();
      })
      .Editable(editable =&gt; editable.Mode(GridEditMode.InCell))
      .Pageable()
      .Sortable()
      .Scrollable()
      .DataSource(dataSource =&gt; dataSource
          .Ajax()
          .Batch(true)
          .ServerOperation(false)
          .Events(events =&gt; events.Error(&quot;error_handler&quot;))
          .Model(model =&gt;
          {
              model.Id(p =&gt; p.ID);
              model.Field(p =&gt; p.ID).Editable(false);
              model.Field(p =&gt; p.Category).DefaultValue(ViewData[&quot;defaultCategory&quot;] as Test.Business.Category);
          })
          .PageSize(20)
          .Read(read =&gt; read.Action(&quot;OrganizationDetails_Read&quot;, &quot;OrganizationDetails&quot;).Data(&quot;LoadParams&quot;))
          .Create(create =&gt; create.Action(&quot;OrganizationDetails_Create&quot;, &quot;Grid&quot;))
          .Update(update =&gt; update.Action(&quot;Organization_Update&quot;, &quot;Grid&quot;))
      )
      .Resizable(resize =&gt; resize.Columns(true))
      .Reorderable(reorder =&gt; reorder.Columns(true))
  )
  
  &lt;input type=&quot;hidden&quot; id=&quot;orgID&quot; value=&quot;1&quot; /&gt;
  
  &lt;script id=&quot;dropdownTemplate&quot; type=&quot;text/x-kendo-template&quot;&gt;
      @(Html.Kendo().DropDownListFor(m =&gt; m)
          .Name(&quot;myDropDown&quot;)
          .DataValueField(&quot;ID&quot;)
          .DataTextField(&quot;Name&quot;)
          .BindTo((System.Collections.IEnumerable)ViewData[&quot;categories&quot;])
      )
  &lt;/script&gt;
  
  &lt;script type=&quot;text/javascript&quot;&gt;
      function error_handler(e) {
          if (e.errors) {
              var message = &quot;Errors:\n&quot;;
              $.each(e.errors, function (key, value) {
                  if ('errors' in value) {
                      $.each(value.errors, function () {
                          message += this + &quot;\n&quot;;
                      });
                  }
              });
              alert(message);
          }
      }
  
      function LoadParams() {
          var id = $(&quot;#orgID&quot;).val();
          return { ID: id }
      }
  &lt;/script&gt;
  </code></pre>
  <p>However, it's never working as it should be. Does anyone have experience this issue? And how did you manage it? Thanks for your ideas.</p>