This is a migrated thread and some comments may be shown as answers.

How to show/hide button based on value.

3 Answers 101 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 20 Jan 2014, 03:26 PM
I have a Ajax Bound Grid with this column which works:

  
columns.Bound(c => c.Id).Title("")
.ClientTemplate(@Html.ActionLink("Download", "DownloadReport?Id=#=Id#")
.ToHtmlString());
  How do I modify this to show/hide the URL based on c.IsReportAvailable?

3 Answers, 1 is accepted

Sort by
0
Accepted
Shahzad
Top achievements
Rank 1
answered on 20 Jan 2014, 03:31 PM
 .ClientTemplate("<# if(direction == 1) {#>" +
                "<img src='~/Images/up.png' alt='up'/>" +
                "<#} else if(direction == 0) {#>" +
                "<img src='~/Images/down.png' alt='down'/>" +
                "<#}#>")  
0
Accepted
Greg
Top achievements
Rank 1
answered on 20 Jan 2014, 05:06 PM
Thank you.  I got this working with:
.ClientTemplate("# if(IsReportAvailable) {#" +
       "<a href=\"/PropertySearch/Order/DownloadReport?Id=#=Id#\">Download</a>" +
       "#}#");

 

0
Dimiter Madjarov
Telerik team
answered on 21 Jan 2014, 09:21 AM
Hello Greg,


We are glad that the issue is resolved. Do not hesitate to contact us again if you experience further problems.

Have a great day!

Regards,
Dimiter Madjarov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Greg
Top achievements
Rank 1
Answers by
Shahzad
Top achievements
Rank 1
Greg
Top achievements
Rank 1
Dimiter Madjarov
Telerik team
Share this question
or