Dropdownlist not showing on popup edit template

4 posts, 0 answers
  1. David
    David avatar
    1 posts
    Member since:
    Sep 2012

    Posted 02 Oct 2012 Link to this post

    This code in my view is not producing a visible dropdown list in the browser:

    edit template code
     @(Html.Kendo().DropDownList()
                    .Name("Sex")
                    .BindTo((System.Collections.IEnumerable)ViewData["Sexes"])
                    .DataValueField("SexId")
                    .DataTextField("SexName")
                    
                )


    resulting html
    <input id="Sex" name="Sex" type="text" value="2"/>
    <script>
    jQuery(function(){jQuery("#Sex").kendoDropDownList({dataSource:[{"SexId":1,"SexName":"Male"},{"SexId":2,"SexName":"Female"}],dataTextField:"SexName",dataValueField:"SexId"});});
    </script>

    What am I doing wrong here?  Please help :)
  2. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 05 Oct 2012 Link to this post

    Hi David,


    Your code looks valid, however it seems that there are missing references to the KendoUI scripts in the project. You can check the JavaScript dependencies article for more information how to include them.

    For your convenience I prepared a small sample, based on the information that you provided so far and attached it to this thread.


    Kind Regards,
    Vladimir Iliev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. William John Adam Trindade
    William John Adam Trindade avatar
    3 posts
    Member since:
    Apr 2010

    Posted 06 Dec 2012 Link to this post

    Hi Vladimir,

    I have the same problem. Your sample works becouse it is not a Editor Template open by a Grid(edit mode Popup).

    If I use 

     @(Html.Kendo().DropDownList().Name("Sex").BindTo((System.Collections.IEnumerable)ViewData["Sexes"]).DataValueField("SexId").DataTextField("SexName"))
    in the (Editor template for grid editable)Popup Window I get an INPUT Type=Text

    If I use 
    @(Html.Kendo().DropDownList().Name("Sex").BindTo((System.Collections.IEnumerable)ViewData["Sexes"]).DataValueField("SexId").DataTextField("SexName"))

    in the Index View, works perfectly.


    My Version is: 2012.3.1114
    
    I am using VS 2012 sp1 and MVC 4

    Any other ideas?

    Thanks

  5. Vladimir Iliev
    Admin
    Vladimir Iliev avatar
    2172 posts

    Posted 11 Dec 2012 Link to this post

    Hi William,

    Loading widgets inside Kendo Grid Custom PopUp Editor is not related to the original topic of the current tread  - may I kindly ask you to open a new support thread with more details about your current setup?

    Kind Regards,
    Vladimir Iliev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready