Here is the js code:
function SelectAllCheckedChanged() {
var grid = window['<%= rgManufacturerDisplay.ClientID %>'];
var inputElements = grid.MasterTableView.Control.getElementsByTagName("INPUT");
var headerChecked = window.event.srcElement.checked;
var index;
for (index = 0; index < inputElements.length; index++) {
//NOTE: The GetElementsByTagName("INPUT") will return ALL input controls in the grid, so we have
//to filter to the ones that we specfically care about.
if (inputElements[index].id.indexOf("chkDistributor") != -1) {
//If the id of the control is "chkDistributor" then this is the checkbox in the Select column
//for the grid row and we need to check/uncheck it (only if it's enabled).
if (!inputElements[index].disabled) {
inputElements[index].checked = headerChecked;
}
}
}
}
However now I have to add a second column, and need it to do the same thing...that is select or unselect all the rows in THAT column.
I've tried a couple of things, but not yet had much success. The second column ID is chkContractor.
Anyone got any ideas of how I would do this with JavaScript?
Thanks.