I am using mvc and mvccontrib grid for the first time. I have my mvcContrib grid like so:
<%Html.Grid(Model.Results)
.RowAttributes(row => new Hash(@class => row.Item.CadPriority1 ? "redgrid" : row.IsAlternate ? "alternategrid" : "grid"))
.Columns(column =>
{
column.For(c =>
(c.ExistsInPatRec == true) ?
Html.ActionLink(c.CaseNumber.ToString(), "Details", new { id = c.CaseNumber }, new { target = "_blank" })
: Html.Label(c.CaseNumber.ToString())
)
.Named("Case Number").SortColumnName("CaseNumber")
.Encode(false)
;
column.For(c => c.ProblemDesc).Named("Problem Code").SortColumnName("ProblemCode");
column.For(c => c.DispatchDesc).Named("Dispatch Code").SortColumnName("DispatchCode");
})
.Sort(Model.SortOptions)%>
Now,I want to add an image(based on a condition) in the first column - next to the link. How can I achieve this?
Build the HTML with a string.Format. Something like this: