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

DropDownList in toolbar showing as a text box, so doesn't work

1 Answer 321 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Avrohom Yisroel
Top achievements
Rank 1
Avrohom Yisroel asked on 19 Jul 2012, 08:45 PM
Hello,

I'm using the ASP.NET MVC helpers for KendoUI, and have version 2012.2.710.340 included in my project. I'm trying to add a toolbar to the grid, so the user can filter the data. I have copied code form the sample, but it's not working.

My grid markup in the Razor view looks like this...
@(Html.Kendo().Grid(Model)
           .Name("AllTickets")
           .DataSource(ds => ds.Server().Model(m => m.Id(t => t.ID)))
           .ToolBar(toolbar => toolbar.Template(
             @<text>
                Site:
                @(Html.Kendo().DropDownList()
                                                  .Name("SiteFilter")
                                                  .DataTextField("SiteName")
                                                  .DataValueField("ID")
                                                  .OptionLabel("Any")
                                                  .DataSource(dataSource => dataSource.Read("GetSitesForView""Home"))
                                                  .Events(events => events.Change("change"))
                    )
              </text>
                                 ))
           .Columns(cols => {
             cols.Bound(t => t.ID).Title("ID").Title("Ticket ID").Filterable(true).Width(50);
             cols.Bound(t => t.Site).Title("Site").Filterable(true);
             cols.Bound(t => t.DhrNumber).Title("DHR Number").Filterable(true).Width(100);
             cols.Bound(t => t.Room).Title("Room").Filterable(true);
             cols.Bound(t => t.ShortSummary).Title("Ticket Description").Filterable(true);
             cols.Bound(t => t.Status).Title("Ticket Status").Filterable(true).Width(80);
           })
    )

The grid itself displays fine, but the toolbar doesn't. You can see how it looks here...


As you can see, I have a text box instead of a dropdown.

Anyone any ideas? I've spent hours on this, and just can't see what I've done wrong.

Thanks

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 20 Jul 2012, 07:09 AM
Avrohom,

As we have replied you in the support ticket you have open, the DropDownList are not loaded due to a JavaScript error. The handler assigned to their change event does not exist.
 
Greetings,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Avrohom Yisroel
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or