I have the following code in a partial view;
<%= Html.Grid(Model).Columns(column =>
{
column.For(model => model.Date).Format("{0:d}");
column.For(model => model.DayAmount);
column.For(model => model.LeaveType);
})
%></div>
<p><%= Html.Pager((IPagination)Model)%></p></div>
The latest requirement is to set the colour of the row depening on the leave type.
So I intend to add a colour column to the datatable, say LeaveRowColour.
When I Google search on MVCContrib I notice that maybe I should use the RowAttributes property to set this. But I am not clear how to do this, or whether I should find another solution.
You could write a custom HTML helper to determine the CSS class to apply:
and then: