0

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

kalu
  • 337
  • 2
  • 9
  • 19

1 Answers1

1

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>
)
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928