How can i get this work in MVC Telerik Grid Control
columns.Template(e =>
{
if (e.EndDate>DateTime.Now )
{
@Html.ActionLink("Stop", "StopMedication", "Medication",
new { id = e.PrescriptionID }, new { @class = "standard button" })
}
else {
@Html.ActionLink("Renew", "RenewMedication", "Medication",
new { id = e.PrescriptionID }, new { @class = "standard button" })
}
});
The following snippet should work perfectly fine in the Telerik Grid template column using Razor syntax:
Taking use of the
@<text></text>inside of the template, as well as using the @item object, which represents the current item (entity tied to the row) and it’s properties, will allow you to have this template up and running.