I'm displaying a grid of data, and one of the attributes is an expiration date. If the expiration date is less than 60 days away, I'd like to highlight the row.
I found this post, and used the answer there to use the RowAttributes
function:
@Html.Grid(Model.PagedList).Columns(column =>{
column.For(m => m.Name);
column.For(m => m.ExpirationDate);
}).Sort(Model.GridSortOptions)
.Attributes(@class => "grid")
.RowAttributes(m => new MvcContrib.Hash(@class =>
(m.Item.ExpirationDate.Value.AddDays(-60) < DateTime.Now)) ? "warning" : "")
But I get a compilation error saying:
Cannot implicitly convert type 'MvcContrib.Hash' to 'bool'
What am I doing wrong here?