joeyan Posted March 2, 2011 Share Posted March 2, 2011 I had 3 different gridview in same asp page, each gridview have its own 'Check All" checkbox button in header and a checkbox in each row of the gridview as I need to do some batch update & insert for selected rows.my problem is that if I check the "Check All" checkbox in either one gridview, it will check all the checkbox including other gridview. I had already declared the gridview id in th code.how can i control the "check All" checkbox to check the checkbox in its own gridview only ? Thanks. function selectAllGridview1(id) { var grid = document.getElementById("<%= GridView1ClientID %>"); var cell; if (grid.rows.length > 0) { for (i = 1; i < grid.rows.length; i++) { cell = grid.rows[i].cells[0]; for (j = 0; j < cell.childNodes.length; j++) { if (cell.childNodes[j].type == "checkbox") { cell.childNodes[j].checked = document.getElementById(id).checked; } } } } } Link to comment Share on other sites More sharing options...
justsomeguy Posted March 2, 2011 Share Posted March 2, 2011 I don't see a reason why it would do that, but it might help to see the actual HTML and Javascript output that the browser is running. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.