我需要根据模型中的布尔值条件格式化单元格值.我有列col.For(item => item.Detail); 如果item.Unfinished我需要应用一些CSS样式我该怎么做?
答案在我对原帖的评论中:
http://groups.google.com/group/mvccontrib-discuss/browse_thread/thread/f872d298cc9d53dc
column.For(x => x.Surname).Attributes(x => {
if(x.Item.Surname == "foo") {
return new Dictionary<string, object> { { "style", "color:red"} };
}
return new Dictionary<string, object>();
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2987 次 |
| 最近记录: |