views:

281

answers:

2

I have been given a mockup that I do not know is possible to code in ASP.NET without being a real html and javascript wizard.

I want a GridView that when a row is selected, the selected row expands and below the selected row a panel of additional information is shown, which would also include another small GridView. The idea is this would all be in-line. So if the user selected row 4, then the additional information would appear below row 4 and then after the additional information the parent GridView would continue with row 5.

Ultimately I would want to do a multi-select type of set up, but first I need to figure out if this is even possible. Also, the solution must be 508 Compliant

The one solution I considered was using only one "column". Then I would put all my fields in the ItemTemplate, and my detail panel content in the EditItemTemplate and instead of selecting the row, set it to edit mode. The problem with this solution is I lose the functionality of multiple columns if I throw everything in one huge ItemTemplate.

Any and all suggestions or ideas are appreciated.

+1  A: 

I've done this using a gridview inside a ListView and using ajaxcontroltoolkit collapsible panel

Your parent list would be a listview that would have 2 table rows for each item, on the first row your parent column, on the second row use colspan and add a gridview wrapped on a collapsible panel

alejandrobog
+1  A: 

What you're describing would be best fulfilled with a ListView control. It takes a little more templating work to set up than a grid view, but you have much more control over it and you can emulate the look of a GridView. You would set your Selected Item template to contain another ListView (or GridView) thats bound to your detailed data.

Barry
But would that solution still provide the dynamic column sizing that a GridView provides? One column of my data is address information. Some addresses are huge, some small. The way the GridView dynamically determines column sizes is very beneficial.
Justin C
If you use table rows for the item template, you'll have the same result
alejandrobog
The gridview is just generating a table, which is where the automagic column sizing comes from (if you don't override it yourself). If you data is tabular, use tables in your templates.
Barry
Thanks for the help. This solution seems to be what I am looking for, but it has opened up a new problem. The new problem is really it's own question, so I wanted to accept an answer on this one but leave a reference to the other one: http://stackoverflow.com/questions/2969744/asp-net-listview-full-row-select
Justin C