kalu
kalu

Reputation: 337

TextArea in mvc web grid

I have a GridView, how do I display in a TextArea the information of the field "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: @<text>
                 @Html.ActionLink("Edit", "ModelosEdit", new { id = item.IdInform }) 
                |
                @Html.ActionLink("Delete", "Delete", new { id = item.IdInform })
              </text>    )})

Blessings

Upvotes: 0

Views: 1102

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038720

You could use a custom format as you did with the last column:

grid.Column(
    "Content", 
    header: "Content", 
    format: 
        @<text>@Html.TextArea("Content", (string)item.Content)</text>
)

Upvotes: 1

Related Questions