sleath
sleath

Reputation: 871

C# ASP.NET Collapsible Gridview

Is there a way to create a collapsible ASP.NET gridview displaying a parent child relationship based on a check box click?

Upvotes: 0

Views: 2297

Answers (2)

G-Wiz
G-Wiz

Reputation: 7426

An easy solution would be to wrap your GridView in an UpdatePanel, and just code everything as you would with normal postbacks. But this is a very heavy-handed approach.

Another option is to use Microsoft's AJAX Library to invoke PageMethods. See the second example here: http://www.asp.net/ajax/documentation/live/Tutorials/ExposingWebServicesToAJAXTutorial.aspx . Once the page loads, you can bind a function to the checkboxes' click events that invokes a PageMethod to inject the appropriate HTML labels and inputs into the row, with a link that passes the values from the form to a different PageMethod.

Upvotes: 1

Cylon Cat
Cylon Cat

Reputation: 7201

I don't think that any of the Microsoft grids can do that. However, third party grids will do this. We used ComponentArt's grid control on my last project, and used it to do exactly what you want.

Upvotes: 1

Related Questions