开发者

Help with MvcContrib Column options

I am using the MVCContrib grid and I would like to add some html attributes to a cell depending on the value of a column. I need something like this

 column.For(c => c.Type.Equals("Type A") ? 
     "show value and add attribute" : "just show value");

I tried this but it doesn't work. It shows the value on the grid as - class="Type A"

column.For(c => c.开发者_开发百科Type.Equals("Type A") ? c.Type.AsClassAttribute() : c.Type);

Please help. Thanks!


Try the following:

column.For(c => (c.Type.Equals("Type A") ? c.Type.AsClassAttribute() : c.Type));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜