1
我有一個ASP.Net MVC Webgrid,當'SuccessRate'列小於零時,我需要顯示'N/A'。你知道我會怎麼做嗎?以下是我的CSHTML的一部分:如何在ASP.Net MVC WebGrid列中隨時更改值?
@grid.GetHtml(
tableStyle: "grid",
headerStyle: "head",
alternatingRowStyle: "alt",
columns: grid.Columns(
grid.Column("ABC"),
grid.Column("Units", "units"),
grid.Column("Min_Req_Res_Points", "mrrp"),
grid.Column("Min_Req_NRes_Points", "mrnrp"),
grid.Column("Total_Applications_Available", "avail"),
grid.Column("Total_Applications_Submitted", "total"),
grid.Column("Season_Number", "Season"),
grid.Column("Year"),
grid.Column(columnName: "SuccessRate",
format: @<text>@item.Success_Rate</text>)
我能得到的代碼通過使用此工作: – KeelRisk 2011-04-17 05:40:48
grid.Column(COLUMNNAME: 「成功率(%)」,格式:?項目=> @ item.Success_Rate <0「N/A「:@ item.Success_Rate) – KeelRisk 2011-04-17 05:41:03