我的网格中有一个下拉列表在我的工具栏中。我想用该网格的列名填充下拉列表。有什么建议么?
@(Html.Kendo().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Bound(p => p.Name).Groupable(false);
columns.Bound(p => p.FullName);
//columns.Command(commandAction: command => command.Custom("ViewDetails").Click("showDetails"));
})
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Customers_read", "jvIndex"))
.PageSize(1)
)
.ToolBar(toolbar =>
{
toolbar.Template(@<text>
<div class="toolbar">
<input type="text" class="k-input"/>
@(Html.Kendo().DropDownList()
.Name("categories")
.OptionLabel("All")
.DataTextField("")
.DataValueField("")
.Events(e=>e.Change("categoriesChange"))
.BindTo()
)
<button class="k-button" id="get">Filter</button>
</div>
</text>);
})
.HtmlAttributes(new { style = "height: 430px" })
.Pageable()
.Sortable()
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.ServerOperation(false)
.Model(model => model.Id(p => p.Name))
.Read("ToolbarTemplate_Read", "jvIndex")
)
) )