Hi,
I want to do if else condition in webgrid.
I tried to follow like in link but got some error Conditionally display an image in webgrid - mvc 3
this is my code
@webGrid.GetHtml(
htmlAttributes: new { @id = "WebGrid", @class = "table table-striped table-hover" },
columns: webGrid.Columns(
webGrid.Column("No.", format: item => item.WebGrid.Rows.IndexOf(item) + 1 + Math.Round(Convert.ToDouble(webGrid.TotalRowCount / webGrid.PageCount) / webGrid.RowsPerPage) * webGrid.RowsPerPage * webGrid.PageIndex),
webGrid.Column("ph_no", "PH Number"),
webGrid.Column("platform_name", "Platform Name"),
webGrid.Column("baseType", "Base Type"),
webGrid.Column("Email", format:(item) =>
{
if (item.emailstatus == true)
{
@Html.ActionLink("Send Email", "SendEmail", "Home", new { id = item.platform_id }, new { @class = "btn btn-warning btn-default", id = "btnSubmit" });
}
else if (item.emailstatus == false)
{
<a href="" class="btn btn-success" disabled>Successfully Sent</a>
}
}
))
the error: