I have an ASP.NET page with several Gridviews on it. I want to be able to collapse the rows so I can see all of the gridviews and then be able to expand a gridview's rows so I can see the data on-demand. Any ideas on how to do this?

Well not sure about this but I think you can try this out.

I am assuming that you are using Nested Grids i.e a parent gridview with each row being a gridview in itself.

1). Add an HTML image control as one more column along with the gridview.

2).Add a javascript to its onclick event to change the display style of the gridview control to none/block to show/hide the gridview resp.

3). Hope this solves your purpose. You can also change the image to expand/collapse icon to give effect on each click.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.