I have a radgrid and i have added radtreeview control in the item template. We have enabled the checkbox option for radgrid. I have a normal checkbox (like select all) at the radgrid header template. if I check this normal checkbox, then all the checkboxes (of the tree nodes) of all treeviews in the item template of the radgrid should be checked and if we uncheck then it should uncheck. I need to achieve this by using jquery. Because, we don't have option to handle this on server side. I have written the below script but id does not work for me.
function SelectAllNodes(check, parentID) {
var parent = $("#" + parentID)[0];
if (parent) {
$('#' + parent.id).find('tr').each(function () {
var row = $(this);
row.find("#RadTreeView1").find("INPUT[type='checkbox']").each(function () { $(this).attr("checked", check) });
});}}
Here 'parentID' is the radgrid control id and 'RadTreeView1' is the radtreeview control id placed in the item template. I want to loop through each tr of radgrid row's instead of using radgrid client side methods to get each row of radgrid.
Please help me on this.
Thanks
function SelectAllNodes(check, parentID) {
var parent = $("#" + parentID)[0];
if (parent) {
$('#' + parent.id).find('tr').each(function () {
var row = $(this);
row.find("#RadTreeView1").find("INPUT[type='checkbox']").each(function () { $(this).attr("checked", check) });
});}}
Here 'parentID' is the radgrid control id and 'RadTreeView1' is the radtreeview control id placed in the item template. I want to loop through each tr of radgrid row's instead of using radgrid client side methods to get each row of radgrid.
Please help me on this.
Thanks