有条件地在 Telerik MVC Grid 中添加复选框
我正在使用 Telerik Grid for MVC 3 和 aspx 引擎。我必须仅在状态已完成的那些行上添加一个复选框。
columns.Bound(grid => grid.CaseStatus).Width(80);
上面是我的绑定列,现在我必须检查 CaseStatus 值是否是某个特定数字,然后我只需在该行中添加复选框。
columns.Add(c => c.CaseID).Title("").Format("<input type='checkbox' />").Encoded(false).Width(5);
知道如何做到这一点吗?
I am using Telerik Grid for MVC 3 with aspx engine. I have to add a check box only on those rows which status are completed.
columns.Bound(grid => grid.CaseStatus).Width(80);
Above is my bound column now i have to check if CaseStatus value is some specific number then only i have to add check box with that row.
columns.Add(c => c.CaseID).Title("").Format("<input type='checkbox' />").Encoded(false).Width(5);
Any Idea how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 ClientTemplate 来实现此目的:
Exmaple:
模板允许您自定义数据在网格中的呈现方式,并且您可以使用
<#= #>
以与服务器端模板类似的方式嵌入和比较数据绑定表达式。You could use the ClientTemplate to achieve this:
Exmaple:
Templates allow you to customise the way the data is presented in the grid and you can use
<#= #>
to embed and compare databound expressions in a similar way to server side templates.