Home > DeveloperSection > Forums > how to use conditions in telerik grid?
Jayden Bell
Jayden Bell

Total Post:110

Posted on    November-20-2014 2:48 AM

 ASP.NET MVC Telerik Grid  Telerik MVC 

 1 Reply(s)
 1063  View(s)
Rate this:

I am having a telrik grid in my MVC 3.0 application. In grid I want to disable one of my column based on dates .



.HtmlAttributes(new { @class = "grid scroll-pane" })

.Columns(columns =>


columns.Bound(o => o.DocumentLabel).Title(ResourceHelper.GetMessage("Posted_DocumentName")).Template(@<text><a href="@Url.Action("DownloadDocument", "ConsentAndDocument", new { documentId = @item.DocumentId })">@item.DocumentLabel</a></text>).Width(180)

I have a property in model which brings the expiray date from DB & if the expiry date is less or todays date has passed the expiry date (i.e DateTime.Now) then the link of the above column needs to be disabled or the data in that column(i.e links) needs to be disabled , it shud not get clicked

Simons Hood
Simons Hood

Total Post:70

Posted on    November-20-2014 6:08 AM

.ClientTemplate("<#if(condition){#><a href=\"WaitingApprove/<#= LatestVersionId #>\">" + "if link" + "</a><# }

 else{#><a href=\"Edit/<#= Id #>\">" + "else link" + "</a> <# } #>")

Don't want to miss updates? Please click the below button!

Follow MindStick