0
我使用webmatrix 2與剃刀語法。我的數據庫的其中一個字段的值爲1或0.我想將我的webgrid中的字段顯示爲複選框。以下是我試過的代碼:Webgrid顯示檢查某個值
@grid.GetHtml(
tableStyle : "table",
alternatingRowStyle : "alternate",
headerStyle : "header",
columns:
grid.Column(header: "Active", format: (col)=>@Html.Raw("<input type='checkbox' checked='"+ ((col.Active) ? "checked" :"") + "' disabled='true' />"))
我注意到上面的代碼顯示了所有複選框被選中的列。
謝謝。優秀的答案。 – 2013-02-20 08:33:16