Add button in MvcContrib Grid column
I am new to mvc.I am using MvcContrib Html.Grid in my MVC 2 project.I have
an existing Html.Grid where I have to added a new column with a button in
it. I have managed to add a Link,but struggling to add a Button. The code
for adding the link is:
<%: Html.Grid(Model.Results)
.RowAttributes(row => new Hash(@class => row.Item.CadPriority1
? "redgrid" : row.IsAlternate ? "alternategrid" : "grid"))
.Columns(column =>
{
column.For(c =>
c.Status == "Complete" ?
Html.ActionLink("Generate Report",
"GenerateCaseSheetReport", "CareRecord", new { id =
c.CaseNumber }, new { target = "_blank" })
: Html.Label("Generate Report")
)
.Named("Generate Report")
.Encode(false);
column.For(c => c.CrewId);
})
.Sort(Model.SortOptions)%>
I have to use a button instead of Html.ActionLink and enable/disable it
based on the value of "status". Please help.
No comments:
Post a Comment