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

combobox dropdown wont show

3 Answers 380 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
mww
Top achievements
Rank 1
mww asked on 09 Jan 2013, 12:00 PM
Ive just started using Kendo UI for the first time and I cant get the dropdown to show for a combobox.  Heres the code in the view

<li>
               @Html.LabelFor(m => m.UserRole)
               @Html.Kendo().ComboBoxFor(m => m.UserRole).BindTo(Model.UserRoles).AutoBind(true).SelectedIndex(0).Suggest(true)
           </li>

In debug ive checked the contents of Model.UserRoles  and there are currently 3 items.  But when the page displays, I see a normal text box, not a dropdown.  I have the required .js files and .css files loaded, so what am I doing wrong ?

3 Answers, 1 is accepted

Sort by
0
mww
Top achievements
Rank 1
answered on 09 Jan 2013, 01:26 PM
In Firebug console I get an error message

'TypeError: jQuery("#UserRole").kendoComboBox is not a function'

this is whats emitted to the html

<li>
<label for="UserRole">User role</label>
<input data-val="true" data-val-required="The User role field is required." id="UserRole" name="UserRole" type="text" /><script>
jQuery(function(){jQuery("#UserRole").kendoComboBox({"dataSource":["Agency","Artist","Venue"],"autoBind":true,"index":0,"suggest":true});});
</script>
</li> 

0
Iliana Nikolova
Telerik team
answered on 11 Jan 2013, 11:47 AM
Hi Mark,

The most likely reason for this error it that some of the needed resources are missing. Could you please check if everything is correctly included? 
 
Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
mww
Top achievements
Rank 1
answered on 11 Jan 2013, 11:53 AM
I had exactly the same problem with a DropDownList and manged to resolve it myself in the end.  My layout page had the JQuery library linked at the bottom of the page, so it hadnt been loaded when it was being referenced.  Moving this to the top of the page fixed the problem

@Scripts.Render("~/bundles/jquery")
Tags
ComboBox
Asked by
mww
Top achievements
Rank 1
Answers by
mww
Top achievements
Rank 1
Iliana Nikolova
Telerik team
Share this question
or