i have a checkbox column in the grid i need to select all records and unselecte all records in the grid

2 posts, 0 answers
  1. Ganesh
    Ganesh avatar
    10 posts
    Member since:
    Dec 2011

    Posted 04 Jan 2012 Link to this post

    i have a kendo grid with checkbox column.
    i binded a grid with pageable option true my problem is when i check the some rows in page 1 after i change to the page 2 and after come back to page 1 the selected checkboxse are unchecking.
    Can any one guid me how to handle it.
  2. Ashish
    Ashish avatar
    1 posts
    Member since:
    Apr 2013

    Posted 14 May 2013 Link to this post

    Grid should contain something like below,

    columns.Template(p => { }).ClientTemplate("<input type='checkbox' class='checkbox' id='#=AccountID#' /> ").HeaderTemplate("<input type='checkbox' id='SelectAll' onclick='SelectAll();' /> ");

    Then script something like below,

    function SelectAll() {

    var selectAllCheckBox = $('#SelectAll');
    if (selectAllCheckBox != null) {
    $('.checkbox').prop('checked', selectAllCheckBox [0].checked);
Back to Top