The following snippet should work fine in the Telerik grid template column using Razor syntax:
columns.Template( @<text> @if (@item.EndDate > DateTime.Now) { @Html.ActionLink("Stop", "StopMedication", "Medication", new { id = @item.PrescriptionID }, new { @class = "standard button" }) } else { @Html.ActionLink("Renew", "RenewMedication", "Medication", new { id = @item.PrescriptionID }, new { @class = "standard button" }) } </text> );
Using @<text></text>
inside the template, as well as using the @item object that represents the current element (the object attached to the string) and its properties, will allow you to run this template.
source share