Expand all rows in nested gridview when click on a button
I have a nested asp.net gridview .Now i have implemented the functionality of expand and co开发者_Go百科llapse by calling the javascript method when click on '+' and '-' against each row in parent gridview respectively.
Now i have a button in the page and i want to expand all the rows in the gridview when click on this button .and similarly collapse all the rows in the grid view when click on another button.
how do i call the javascript method for each row in the grid ,ie how to call a javascript method in a loop from code behind??
Create a javascript method (expandAllRows) that calls expandSingleRow method for all rows (the loop is in the javascript method) and call it from code behind like your other function.
精彩评论