1
Vote

Multiple grids on one page, select all checkbox problem

description

If you put more than one grid on a page and use the headers checkbox to select all the checkboxes in the grid, it selects all the checkboxes from all grids on the page.
 
Edit GridViewJS.js and replace __CheckAll(me) with this:
 
function __CheckAll(me) {
var index = me.name.indexOf('_HeaderButton');
var prefix = me.name.substr(0, index);
for (i = 0; i < document.forms[0].length; i++) {
    var o = document.forms[0][i];
    if (o.type == 'checkbox') {
        if (me.name != o.name) {
            if (o.id.substring(0, prefix.length) == prefix || o.name.substring(0, prefix.length) == prefix) {
                // Must be this way
                o.checked = !me.checked;
                o.click();
            }
        }
    }
}
}
 
ASP.Net has some oddities with id and name. Going ahead and checking both for the prefix.

comments