how to change MVC WebGrid Cell text color when CarID is greater than 8
Here is my Code:
@{
var grid = new WebGrid(ViewBag.WebGrid, canPage: true, rowsPerPage: 5, ajaxUpdateContainerId:"d");
grid.Pager(WebGridPagerModes.NextPrevious);
}
@grid.GetHtml(
tableStyle: "table",
alternatingRowStyle: "alternate",
selectedRowStyle: "selected",
headerStyle: "header",
columns: grid.Columns(
grid.Column("CarID",
format: @<text>@(item.CarID > 8 ? @item.Carid:@item.Carid)
),
grid.Column("Brand",
format: @<text>
@item.Brand
),
grid.Column("Brand",
format: @<text>
@item.Brand
),
grid.Column("Action",canSort:false,
format: (item) => Html.ActionLink("Edit", "Edit1", new { id = item.CarID }))
));