Reputation: 337
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
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