var grid = new WebGrid(source: Model, ...);
grid.Column("IsValid", "IsValid", format: (item) => (item.IsValid) ?
? Html.Raw("< src='../../Content//' />")
: Html.Raw("< src='../../' />"), style: "testStyle"),
grid.Column(header: "Delete", format:
@<text>
<a href="@Url.Action("Delete", "TestInfo", new { id = item.id })" onclick="javascript:return ConfirmDelete();">
<img src="../../Content/images/image.png" alt="" style="border:none;" />
</a>
</text>, style: "testStyle")
With this code my Delete button appears on every row of the Webgrid. Like the first column, I am trying to impliment the same logic (item) => (item.IsValid)
to display the Delete button image if and only if item.IsValid
is true.
Can you please suggest how can I accomplish this