Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Expand/Collapse detail table

Status
Not open for further replies.

jcale4

Programmer
Aug 31, 2004
63
0
0
US
Hello!

There is a short tutorial on MSDN -


Is there any way to do this with a table? In other words, I have several thousand rows that i'm pulling from a database. I want to show/hide details beneath each grouping. So, a user can click "Account", then the table expands to show the details of the account.

Thanks!
 
You can use ADO Shaped recordsets to do this. This allows you to get all of the necessary data in one trip to the database. You can then loop thru the recordset and subsets and use <div> tags to create the effect you are after.

 
dtqbterror, (and fellow chiefs fan, (they sure laid it down yesterday didnt they?))...

I like the sound of that, unfortunetely I'm not sure what an ADO Shaped recordset is.

Thanks!
 
This is excellent. However, ADO shaping apears to be a way to create hierarchical recordsets by joining tables on related data. I am pulling data from 1 data source which looks like this:

ACCOUNT------NAME-----------SALES---------ITEM
1324---------ACCOUNT1-------1024.00-------FIRSTITEM
1324---------ACCOUNT1-------8432.03-------SECONDITEM
8338---------ACCOUNT2-------20204.20------FIRSTITEM
2309---------ACCOUNT3-------39392.04------FIRSTITEM
2309---------ACCOUNT3-------83.34---------SECONDITEM
2309---------ACCOUNT3-------392.00--------THIRDITEM

..you get the point

So, I dont have a need to relate recordset tables by parent or children since i just select the recordset, then while looping, only show the account if it is different than the previous records account value. I'm not sure how to do this using <div>'s. Can i still use the Shape option with this sort of data source?

Thanks!
 
Sure use a select distinct query to get a single record for each account and then use another query that selects the line item data using the accout number as your selection criteria.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top