
This article presents Expand / Collapse functionality of the GridView rows using the JavaScript. To demostrate this functionality I’ve used an Image on the GridView header. Rows of the GridView will Expand and Collapse on successive clicks on this Image. In the above code, global variables have been initialized in the window.onload event. There are three methods- Toggle, ToggleImage & ToggleImage. The Toggle method is invoked on successive clicks on the header Image. This method first toggles the header imahge & then toggles the rows of the GridView by invoking the ToggleImage & ToggleImage methods.
|