Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Datagridview / Treeview Question

Is it possible to make a datagrid act like a treeview in the way it displays data? Using Northwinds database for example, I'm wanting to list the orders and then have the user click on the order and in the same datagridview display the order details under each order. List a treeview would do.

Is this possible? If so, can you guide me to a site that talks about this?

Thanks

jb
[413 byte] By [jcb1269] at [2007-11-11 10:29:06]
# 1 Re: Datagridview / Treeview Question
http://msdn.microsoft.com/library/en-us/vbcon/html/vbconIntroductiontotheDataGridControl.asp
Phil Weber at 2007-11-11 20:47:33 >
# 2 Re: Datagridview / Treeview Question
Can this work with a Datagridview. I can get it to work with a datagrid from 2003 but not with a datagridview. Any ideas?

Thanks Phil,

jb
jcb1269 at 2007-11-11 20:48:34 >
# 3 Re: Datagridview / Treeview Question
A search for "hierarchical datagridview" found this (http://www.awprofessional.com/articles/article.asp?p=446453&seqNum=2&rl=1):

The DataGrid could be bound to a collection of collections, such as a DataSet, and if so, the DataGrid presented hierarchical navigation controls to move through the collections of data. However, this capability was rarely used, partly because the navigation controls that were presented inside the DataGrid were a little unintuitive and could leave the user disoriented. As a result, the Windows Client team that developed the DataGridView control decided not to support hierarchical navigation within the control. The DataGridView is designed to present a single collection of data at a time. You can still achieve an intuitive hierarchical navigation through data, but you will usually use more than one control to do so, adopting a master-details approach as discussed in previous chapters.
Phil Weber at 2007-11-11 20:49:32 >
# 4 Re: Datagridview / Treeview Question
That's what I do in a different application.

Like always... You da man...

thanks again.
jcb1269 at 2007-11-11 20:50:39 >
# 5 Re: Datagridview / Treeview Question
datagrid view is different from datagrid in the 2003 version of vb.net. in that aspect that you dont have such and "click and show child table" functionallity
l_schuiling at 2007-11-11 20:51:39 >