TextArea在mvc网格中

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

 @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: @
                 @Html.ActionLink("Edit", "ModelosEdit", new { id = item.IdInform }) 
                |
                @Html.ActionLink("Delete", "Delete", new { id = item.IdInform })
                  )})

祝福

0
额外 编辑
意见: 1

1 答案

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

grid.Column(
    "Content", 
    header: "Content", 
    format: 
        @@Html.TextArea("Content", (string)item.Content)
)
1
额外