我有一个Kendo网格,我需要根据不在网格中的下拉列表的值绑定初始页面加载.我需要根据该下拉列表中的用户选择重新绑定网格.我很接近,但我无法弄清楚如何去做,也找不到一个例子.我不确定我需要在onchange事件中放入什么我需要为下拉列表编写(它当前是一个空字符串,当然这是错误的).
任何帮助都是最受欢迎的!
这是标记:
<div class="editor-label">
@Html.Label("Storeroom List")
</div>
<div class="editor-field">
@Html.DropDownList("StoreroomID", new SelectList(ViewBag.storeroomNames, "RoomID", "RoomID"), "-- Select Storeroom --", new { @onchange = "" })
</div>
<br />
@(Html.Kendo().Grid(Model)
.Name("BatchGrid")
.Pageable()
.Sortable()
.Scrollable()
.HtmlAttributes(new { style = "height:675px; width:1200px" })
.Columns(columns =>
{
columns.Bound(b => b.BatchID)
.Width("300px")
.Title("Batch ID");
columns.Bound(b => b.HasErrorTransaction)
.Width("50px")
.Title("Err");
columns.Command(c => c.Custom("Post Batch").Click("onClickPostBatch").HtmlAttributes(new { style = "width:100px;" }));
columns.Bound(b => b.Created_Emp_Name)
.Width("200px")
.Title("Created Employee");
columns.Bound(b => b.Transmitted_DateTime)
.Width("175px")
.Format("{0:MM/dd/yyyy hh:mm tt}")
.Title("Transmitted");
columns.Bound(b => b.Completed_DateTime) …Run Code Online (Sandbox Code Playgroud)