telerik mvc grid 访问单元格数据以启用列。命令
我似乎找不到一种方法来引用网格中列中的值,在我的例子中它是 StatusId。根据该行中的单元格值,对于 StatusId,我需要向方法“.Visible(???)”返回 true 或 false。很高兴能在在线文档中找到答案,但我一直没能找到。我很难相信我会是第一个需要此功能的人。
我将非常感谢任何帮助,因为 Telerik 论坛中没有人知道。
.Columns(columns => {
columns.Command(commands => {
commands.Edit().ButtonType(ButtonType);
commands.Delete().ButtonType(ButtonType);
}).Width(90).Visible(???);
谢谢! AZee
I can't seem to find a way to reference the value in a column in the grid, in my case it is the StatusId. Based on the cell value in this row, for the StatusId, I need to return a true or false to the method ".Visible(???)". It would be nice to find the answer in the documentation online but I haven't been able to. I find it hard to believe that I would be the first person who ever needed this functionality.
I would be most appreciative of any assistance since no one in the telerik forums know.
.Columns(columns => {
columns.Command(commands => {
commands.Edit().ButtonType(ButtonType);
commands.Delete().ButtonType(ButtonType);
}).Width(90).Visible(???);
Thanks!
AZee
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Visible
设置控制列的可见性。如果设置为false
该列根本不会呈现。您可以尝试使用CellAction
:The
Visible
setting controls the visibility of the column. If set tofalse
the column will not render at all. You can try using theCellAction
:上述解决方案不适用于 Ajax 绑定 ....例如,如果我想以红色显示特定单元格的文本颜色 .." 即 Cell_Text="In Error",当网格第一次加载时,则此解决方案适用,但是当我在上述网格上应用一些 Ajax 操作(例如 Filtering )时,我的 Cell_Text 再次变回正常文本颜色....您是否有针对我的特定场景的其他代码
Above solution doesnt work with Ajax Binding ....For example if I want to show a perticular Cell's text Color in Red .." i.e. Cell_Text="In Error", when the Grid loads for the 1st time then this solution becomes applicable but when I apply some Ajax Actions on the said Grid like Filtering , then my Cell_Text again changes back to its normal text color .... Do you have any other codes for my perticular scenario