I am tinkering with the MVCContrib Grid and am stuck on how to format a row of data in the grid based on the data.
For example, say we have a grid of products, where eac
Hello Scott: Try something like the following to add RowAttributes -
@Html.Grid(Model)
.WithModel(new CustomerGridModel())
.Sort(ViewData["sort"] as GridSortOptions)
.Attributes(id => "grid", style => "width: 100%;")
.RowAttributes(data => new MvcContrib.Hash(
@class => data.Item.Discontinued ? "discontinued" : ""))
This will add a class attribute to the tr element. Then, create a class along the lines of:
tr.discontinued td {background-color: red;}
Sorry for the long code snippet...