How to show/hide button based on value.

4 posts, 3 answers
  1. Answer
    Greg
    Greg avatar
    4 posts
    Member since:
    Dec 2013

    Posted 20 Jan 2014 Link to this post

    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?
  2. Answer
    Greg
    Greg avatar
    4 posts
    Member since:
    Dec 2013

    Posted 20 Jan 2014 Link to this post

     .ClientTemplate("<# if(direction == 1) {#>" +
                    "<img src='~/Images/up.png' alt='up'/>" +
                    "<#} else if(direction == 0) {#>" +
                    "<img src='~/Images/down.png' alt='down'/>" +
                    "<#}#>")  
  3. Answer
    Greg
    Greg avatar
    4 posts
    Member since:
    Dec 2013

    Posted 20 Jan 2014 Link to this post

    Thank you.  I got this working with:
    .ClientTemplate("# if(IsReportAvailable) {#" +
           "<a href=\"/PropertySearch/Order/DownloadReport?Id=#=Id#\">Download</a>" +
           "#}#");

     

  4. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2272 posts

    Posted 21 Jan 2014 Link to this post

    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!
Back to Top