Edit Template Checkbox Setting

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    4 posts
    Member since:
    Apr 2013

    Posted 19 Apr 2013 Link to this post


    I have a value that I am reading from a database as a 1 or 0 that I want to display in a list view as YES or NO and when editing as a checkbox...

    I succesfully set the template to show YES or NO by using this code:

    but I can not get the edit_template to show checked when sup == 1... it always displays unchecked.
    Can you help with the proper syntax to read this value for a checkbox in an edit_template?

    Thank you,
  2. Alexander Valchev
    Alexander Valchev avatar
    2895 posts

    Posted 22 Apr 2013 Link to this post

    Hello Andrew,

    Kendo Grid provides checkbox editing for boolean values out of the box. Configuring the same for fields of type number is not recommended - the build in checked binding works with boolean values.

    I suggest you to define the field as boolean type and use the build-in editor (you can still display yes/no values through the template). At the parameterMap function of the DataSource, you can transform the boolean values into numbers and submit them to the server.

    Kind regards,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top