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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Hierarchy of Data...

Status
Not open for further replies.

bartee

MIS
Mar 20, 2005
147
US
I am using asp.net 2.0 VB for developing a web application.

On my page, I want to display Company and Contact information in the following way:

Company Address
ABC Test 123 Main Street
Bob Smith 555-789-5555
Al Rivers 222-555-8888
XYZ Company 345 Main Street

What is the best way to accomplish this?

I currently have two data sets, one for the company information and one for the contact information. These can be related on the key field CompanyID.

I already have a gridview wired up to the Company data source but have not been able to find a way to display the contact data (child records) in ROWS directly below the related Parent Record.

I know you can nest another gridview using a template column but again, I would really like the contact records to appear as rows below the company record.

Can anyone supply an example of this? Should gridviews even be used this way, or is there a better approach?

Any suggestions or examples are greatly appreciated.

Thanks in advance.
 
Just select the relevant columns in one SQL Statement and then bind a GridView to that data source


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top