0

我有一个 GridView,如何在 TextArea 中显示“内容”字段的信息?

 @grid.GetHtml(  fillEmptyRows: false,
            mode: WebGridPagerModes.All,
            firstText: "<< First",
            previousText: "< previous",
            nextText: "Next >",
            lastText: "last >>",
            columns: new [] {
            grid.Column("NameInform", header: "Name"),
               .
               .
               .
               .
            grid.Column("Content", header: "Content"),
            grid.Column(
            "", 
            header: "  ",
            format: @<text>
                 @Html.ActionLink("Edit", "ModelosEdit", new { id = item.IdInform }) 
                |
                @Html.ActionLink("Delete", "Delete", new { id = item.IdInform })
              </text>    )})

祝福

4

1 回答 1

1

您可以像使用最后一列一样使用自定义格式:

grid.Column(
    "Content", 
    header: "Content", 
    format: 
        @<text>@Html.TextArea("Content", (string)item.Content)</text>
)
于 2012-05-25T06:30:09.673 回答