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

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

1 Answer 145 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ganesh
Top achievements
Rank 2
Ganesh asked on 04 Jan 2012, 08:00 AM
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.

1 Answer, 1 is accepted

Sort by
0
Ashish
Top achievements
Rank 1
answered on 14 May 2013, 03:07 PM
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);
}
}
Tags
Grid
Asked by
Ganesh
Top achievements
Rank 2
Answers by
Ashish
Top achievements
Rank 1
Share this question
or