Undefined Values in Kendo Dropdownlist

3 posts, 0 answers
  1. Goldfy
    Goldfy avatar
    6 posts
    Member since:
    Oct 2013

    Posted 05 Nov 2013 Link to this post

    Hi, I am using Telerik's dropdownlist in my MVC application View. I am facing two problems:

     1) When I run my application, I find every value of kendo dropdownlist is "Undefined".
       This is the code for my View:
          @model IEnumerable<EulenMgrKendoUIMvcApplication.Dominio.Tablas.DelegacionProductoUsuario>


                .Name("IdDelegacionProductoDrpDwn").HtmlAttributes(new { @style = "font-size:12px" })

       This is my controller, where I populate the dropdownlist:
       public class DelegacionProductoUsuarioController : Controller
             public ViewResult List()
                IEnumerable<DelegacionProductoUsuario> delegaciones = DelegacionProductoUsuario.GetAll();
                return View(delegaciones);
           private void PopulateDelegacionProducto()
                List<Int64> IdDelegacionProductoList = new List<Int64>();
                foreach( DelegacionProductoUsuario d in DelegacionProductoUsuario.GetAll()){
                ViewData["IdDelegacionProducto"] =IdDelegacionProductoList ;

         I am debugging the application and the controller is passing to the view the proper values,so I don't understand why it doesn't show them.
    2) Second problem: I insert this Dropdownlist in one of the columns of a kendo grid with no success. In it's place it appears a common label. Here is the code for
     my Grid, I mark in Bold the column where I try to show  my dropdownList:
                columns.Bound(d => d.BorradoLogico).Title("Borrado logico");
                columns.Bound(d => d.FTick).Title("Ftick");
               columns.Bound(d => d.IdDelegacionProducto).Title("IdDelegacionProducto").EditorTemplateName("IdDelegacionProductoDrpDwn");    
                columns.Bound(d => d.IdUsuario).Title("IdUsuario");
  2. Daniel
    Daniel avatar
    2174 posts

    Posted 07 Nov 2013 Link to this post


    The enumeration passed to the dropdonwlist should consist of objects that contain properties with the specified names e.g.

    ViewData["IdDelegacionProducto"] = DelegacionProductoUsuario.GetAll();
    List<object> IdDelegacionProductoList = new List<object>();
    foreach( DelegacionProductoUsuario d in DelegacionProductoUsuario.GetAll()){
            IdDelegacionProducto = d.IdDelegacionProducto
    ViewData["IdDelegacionProducto"] = IdDelegacionProductoList;

    As for the second issue - what editing mode are you using? If you are using popup editing then the EditorForModel helper and you should use the UIHint attribute on the model property to specify the editor name. If you are not using popup editing then verify that you have correctly included the editor template and that the name is the same. Regards,
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Goldfy
    Goldfy avatar
    6 posts
    Member since:
    Oct 2013

    Posted 07 Nov 2013 Link to this post

    Thanks Daniel but the code you write to solve my first problem is exactly the same I write in my post. 
    On regard to my second problem, I am doing  what you advice, it is marked Bold.  

Back to Top