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

Select All Checkbox Client Side

1 Answer 29 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 26 Aug 2011, 06:56 PM
Below is a code snippit I found in one of your forums.  It was working fine until I turned on filtering.  Now "id" in gridHeader.childNodes[i].id is null so it fails on ".indexOf".   


function BulkOperationRadGrid_GridCreated(sender, eventArgs) {
    var masterTable = sender.get_masterTableView();
    //check whether all items on the active page are selected    
    if (masterTable.get_selectedItems().length == masterTable.get_pageSize()) {
        /*find the checkbox in the header of the GridClientSelectColumn and set checked state for it - will work with AllowMultiRowSelection = true only!*/
        var gridHeader = masterTable.get_element().getElementsByTagName("TH")[0];
        for (var i = 0; i < gridHeader.childNodes.length; i++) {
            if (gridHeader.childNodes[i].id.indexOf("columnSelectCheckBox") > -1) {
                gridHeader.childNodes[i].checked = "true";
            }
        }
    }

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 26 Aug 2011, 07:41 PM
Hello,

please explain me which type of functionality you want.

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Richard
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or