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

check all the check boxes of radtreeview placed in the item template of radgrid using jquery

1 Answer 129 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jithendra
Top achievements
Rank 1
Jithendra asked on 27 Jan 2015, 03:06 PM
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







1 Answer, 1 is accepted

Sort by
0
Jithendra
Top achievements
Rank 1
answered on 27 Jan 2015, 03:11 PM
Correction for this post is that. We have enable the checkbox functionality for radtreeview not for radgrid. We have enabled tristate funcationality as well.
Tags
TreeView
Asked by
Jithendra
Top achievements
Rank 1
Answers by
Jithendra
Top achievements
Rank 1
Share this question
or