473,498 Members | 1,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hierarchical data in a datagrid

Does anybody know of a good, yet simple example of displaying
hieracrchical data in a datagrid? Ideally, this datagrid should be
similar to a treeview control, where a user can click on a plus sign and
view child records. I have seen this done before but have not done it
myself. There are many example online, but most require a lot of
research into somebody's showcase application, where I know need a small
piece of the functionality. Know what i mean? Thanks...

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
3 2633
Phil,

This is so easy, the only thing that you have to do is making a datarelation
and than set the dataset that has that relation as the datasource and not
the table or a dataview as you maybe are used to do.

http://msdn.microsoft.com/library/de...classtopic.asp

You can as well play than a little bit with the expand property from the
datagrid.

http://msdn.microsoft.com/library/de...xpandtopic.asp

I hope this helps

Cor

"Phil Townsend" <ph*******@yahoo.com>

Does anybody know of a good, yet simple example of displaying
hieracrchical data in a datagrid? Ideally, this datagrid should be
similar to a treeview control, where a user can click on a plus sign and
view child records. I have seen this done before but have not done it
myself. There are many example online, but most require a lot of
research into somebody's showcase application, where I know need a small
piece of the functionality. Know what i mean? Thanks...

Nov 16 '05 #2
Thanks for the reply, but I have tried this. I have a stored procedure
that returns three result sets, all of which are placed into the
dataset. I then define two datarelations to link the three tables
together. When I run the page, I get the datagrid with the data from
from the first table only. Is there something else I am not doing?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #3
Phil,

You say Page are you talking about a webpage, I am talking about a
windowsform datagrid?

(I never did it with three relations by the way only with 1)

Cor
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2590
by: Daisy | last post by:
Let's say I've got a forum, where users can be moderators of each forum. Tables look like this: USER -------- user_key name FORUM
5
2234
by: clintonG | last post by:
I'm looking for documentation and would not turn my nose up to any code from anybody who thinks they are good at the design of an algorythm that can be used to generated a hierarchical relational...
1
5975
by: Grey | last post by:
is there any sample for building a Hierarchical datagrid in c# window application
0
1424
by: stigbn | last post by:
When a DataSet is used as data source for a DataGrid one can get hiearachical datagrid by using relations among the DataTables of the DataSet. (By hierarchical datagrid, I mean columns that can be...
0
1287
by: Dan C Douglas | last post by:
I have created a hierarchical datagrid that consists of 1 datagrid nested insde of another datagrid. More technically it is actually 1 User control that contains a datagrid. I add this user control...
0
1014
by: PontiMax | last post by:
I'm working with the Northwind database tables 'Customers', 'Orders', and 'Order Details': 'CustomerID' relates 'Orders' to 'Customers', and 'OrderID' relates 'Order Details' to 'Orders'. For...
5
2176
by: adh | last post by:
Winforms Datagrid Qoute (MSDN): Expanders are displayed in each parent row that contains a child table. Clicking an expander generates a list of Web-like links to the child tables, which when...
4
7586
by: Congero | last post by:
I'm trying to find a way to bind hierarchical data to a gridview control. I've been able to do this with some third party controls and was wondering if this functionality is available with the...
4
4359
by: Marco Pais | last post by:
Hi there. I am trying to find th best way (best UI control) to present hierarchical data, nested tables. For example, I have a Employees table (id, name) and EmployeesSales (id, idEmp,...
0
7126
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5465
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.