C# 使用MVC3在WebGrid中自定义显示动态数据

C# 使用MVC3在WebGrid中自定义显示动态数据,c#,asp.net-mvc,asp.net-mvc-3,C#,Asp.net Mvc,Asp.net Mvc 3,我在MVC 3.0中有一个WebHelpers WebGrid,如果某个字段的值设置为某个值,我希望自定义显示该字段 grid1.Column(columnName : "Process_ID",format:@<text>@if (item.Process_ID == 26){<text><SPAN STYLE="background-color: yellow">&nbsp;&nbsp;HELLO&nbsp;&nbsp;&l

我在MVC 3.0中有一个WebHelpers WebGrid,如果某个字段的值设置为某个值,我希望自定义显示该字段

grid1.Column(columnName : "Process_ID",format:@<text>@if (item.Process_ID == 26){<text><SPAN STYLE="background-color: yellow">&nbsp;&nbsp;HELLO&nbsp;&nbsp;</SPAN></text>} </text> ),
grid1.Column(columnName:“进程\u ID”,格式:@@if(item.Process\u ID==26){HELLO}),
grid1.Column(columnName:“进程ID”,格式:(item.Process\u ID==26)?“嗨”:“再见”}),
grid1.Column(columnName : "Process_ID",format:(item.Process_ID == 26)?"<text>Hi</text>":"<text>Bye</text>"}),