Conditional in Client Template

2 posts, 0 answers
  1. David
    David avatar
    6 posts
    Member since:
    Sep 2015

    Posted 30 May 2016 Link to this post


    I'm trying to display a list of checkbox items inside of a list view ONLY if the boolean isSelected field is false.

    Here is how I call the listview:
            .DataSource(dataSource => dataSource

    My TestView model:
    public class TestVM
            public int ID { get; set; }
            public string Name { get; set; }
            public bool IsSelected { get; set; }

    ..and here is my Client template:

    <script type="text/x-kendo-tmpl" id="template">
        <div class="product">
            # var isSelected =  @#:IsSelected#;
            if (isSelected !== true) { # @(Html.Kendo().CheckBox().Name("#:ID#").Label("#:Name#"))  # } #

    I get a failure in the client template.

    Any suggestions are appreciated.

    Thanks in advance,
  2. Venelin
    Venelin avatar
    352 posts

    Posted 31 May 2016 Link to this post

    Hello David,

    Your question was answered in the support ticket you sent. Please avoid duplicating threads so we can better track the issues discussed.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top