views:

34

answers:

1

What is the best way, using ASP.NET and C#, to tackle the following problem?

I have a database containing a companies table, product table (each company has multiple products, though the tables aren't linked), and a details table.

What I'd like is to display the companies table. Selecting a company reveals the products table for that company. Selecting a product reveals a details table.

I'd like to place this all inside an update panel, so that only this part of the page updates, and was wondering what the community thought was the best approach.

I'm wondering, currently, whether it's possible to programmatically change the datasource of a single gridview. Or perhaps it would be best to have multiple gridviews and change visibility?

Or perhaps gridviews are not the way to go? I don't know.

Any feedback would be greatly appreciated!

+1  A: 

Hey,

I achieved one level of nesting easily with the ListView, which was great because it gave me full control over the UI so I could create the nesting process easily, I could devote two TR tags per entry, the first contains the details, and the second contains the drop down panel. You could easily next two-three levels of panels. You can easily setup multiple Lists to create the nested structure. I wrote JS script to show/hide the panels.

That I found worked for me.

HTH.

Brian
I didn't use this technique in the end as I wanted distinct tables, rather than a nested view. It's a nice idea though, thanks for the help!
Rich