【发布时间】:2013-06-07 18:58:29
【问题描述】:
我正在尝试使用 html 帮助程序通过数据源配置在我的视图中动态添加网格过滤器,例如来自 kendo documentation 的示例:
@(Html.Kendo().Grid<Product>()
.Name("grid")
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("Products_Read", "Home"))
.Filter(filters =>
{
if (someCondition){
// Show products whose ProductName property contains "C"
filters.Add(product => product.ProductName).Contains("C");
// and UnitsInStock is greater than 10
filters.Add(product => product.UnitsInStock).IsGreaterThan(10);
}
})
)
)
添加了过滤器,但每种情况下的 filterdescriptor.Value 始终为 null(Member 和 Operator 都可以)。
非常感谢任何帮助。 谢谢! --贝瑞
【问题讨论】:
标签: kendo-ui kendo-grid kendo-asp.net-mvc