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

[Solved] Combobox, stuck on step 1

1 Answer 35 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Joe
Top achievements
Rank 1
Joe asked on 04 Nov 2010, 09:34 PM
Hello,

I am evaluating the combobox, but can not get it working with a simple asp.net mvc demo. The combobox is rendered on the page, but clicking the pulldown button or entering text does not display the items.

VS2010, ASP.NET MVC V2, IE8, .NET 4.0, IIS 5

view.aspx page
<head id="Head1" runat="server">
  
        <!-- other content -->
    <%= Html.Telerik().ScriptRegistrar() %>
      
      
<%= Html.Telerik().StyleSheetRegistrar()
        .DefaultGroup(group => group.Add("telerik.common.css")
                                    .Add("telerik.vista.css"))
%>
<title>Teleric</title>
</head>
<body>
<div>Hello World</div>
    <div>
<% Html.BeginForm("Save", "Home"); %>
<%= Html.Telerik().ComboBox()
    .Name("productID")
    .Items(item => 
    {
        item.Add().Text("Chai").Value("1").Selected(true);
        item.Add().Text("Chang").Value("2");
        item.Add().Text("Tofu").Value("3");
    }) 
%>
<% Html.EndForm(); %>
    </div>
</body>

Web.Config
<namespaces>
  <add namespace="System.Web.Mvc" />
  <add namespace="System.Web.Mvc.Ajax" />
  <add namespace="System.Web.Mvc.Html" />
  <add namespace="System.Web.Routing" />
          <add namespace="Telerik.Web.Mvc.UI" />
</namespaces>


When using view source on the page.
   
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
   
<head id="Head1">
   
        <!-- other content -->
    <script type="text/javascript" src="/Scripts/jquery-1.4.2.min.js"></script>
<link type="text/css" href="/Content/telerik.common.min.css" rel="stylesheet"/>
<link type="text/css" href="/Content/telerik.vista.min.css" rel="stylesheet"/>
<title>
    Teleric
</title></head>
<body>
<div>Hello World</div>
    <div>
<form action="/Home/Save" method="post"><div class="t-widget t-combobox t-header" id="productID"><div class="t-dropdown-wrap t-state-default"><input class="t-input" id="productID-input" name="productID-input" title="productID" type="text" value="Chai"></input><span class="t-select t-header"><span class="t-icon t-arrow-down">select</span></span></div><input id="productID-value" name="productID" style="display:none" type="text" value="1"></input></div>
</form>
    </div>
</body>
</html>


Any help would be greatly appreciated.

1 Answer, 1 is accepted

Sort by
0
Joe
Top achievements
Rank 1
answered on 05 Nov 2010, 12:53 AM
Read the manual, put scriptregister at end. Fixed issue
Tags
ComboBox
Asked by
Joe
Top achievements
Rank 1
Answers by
Joe
Top achievements
Rank 1
Share this question
or