This is a migrated thread and some comments may be shown as answers.

Dropdownlist not showing on popup edit template

3 Answers 351 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 02 Oct 2012, 03:17 PM
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 :)

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 05 Oct 2012, 01:13 PM
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!
0
William John Adam
Top achievements
Rank 1
answered on 06 Dec 2012, 03:21 PM
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

0
Vladimir Iliev
Telerik team
answered on 11 Dec 2012, 11:18 AM
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!
Tags
DropDownList
Asked by
David
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
William John Adam
Top achievements
Rank 1
Share this question
or