I am having difficulty trying to figure out how to convert our server side grid to ajax grid due to some road blocks. We are upgrading our grid from the older Telerik MVC extensions grid to the new Kendo UI grid and I have run into a couple of issues with converting some conditional statements to be usable within the ClientTemplate. Can anyone assists on the correct way to convert the following line of code to be compatible with ClientTemplate?
I was able to do
To get true or false returned from the method call, but I cannot figure out how to place the result returned into a conditional if-else statement to determine which html should display based on the condition as shown in the original code.
columns.Template(@<
text
>
@if(String.IsNullOrEmpty(Model.DownloadURL(item.DocumentId,item.Name, item.ExtUrl)))
{ }
else
{
<
a
href
=
"@Model.DownloadURL(item.DocumentId,item.Name,item.ExtUrl)"
title
=
"Click to download"
>
}</
text
>).Title("Download")
I was able to do
columns.Bound(p=>p.DocumentId).ClientTemplate(String.IsNullOrEmpty(@Model.DownloadURL("#=DocumentId#","#=Name#","#=ExtURL#)).ToString()).Title("Download")