答案 0 :(得分:1)
嘿这是我在网格中使用的内容。这可能对你有帮助。
<h1>@Page.Title</h1>
<form method="post">
@Html.DropDownList("OrderID", orders)
<input type="submit" />
</form>
@if(grid != null){
@grid.Table(
columns: grid.Columns(
grid.Column("ProductName", "Product", style: "_220"),
grid.Column("UnitPrice", "Price", style: "_60", format: @<text>@item.UnitPrice.ToString("c")</text>),
grid.Column("Quantity", style: "_90"),
grid.Column("TotalCost", "Total Cost", style: "_90", format: @<text>@item.TotalCost.ToString("c")</text>)
),
footer: @<table class="footer">
<tr>
<td class="_220">Total</td>
<td colspan="2" class="_150"> </td>
<td class="_90">@orderTotal.ToString("c")</td>
</tr>
</table>);
}