Groups | Blog | Home
all groups > dotnet performance > november 2003 >

dotnet performance : Tree view and Datagrid



EricJ
11/24/2003 9:32:05 AM
1 way of doing this
(i don't know how you want to display it exactly, ill give you 1 possibility
you should be able to work from that)

create a class that holds the data (i would suggest putting the code to
manipulate the data in this class 2)
put your data in a dataset
(code not tested don't shoot me if i have some names wrong)
'building the tree
dim node, node2 as treenode
dim c as yourClass
dim r as datarow

tree.clear
for each r in dataset.tables(0).rows
'create a constructor in your class that handles the vars and cast them
c = new yourClass(r(0),r(1),r(2),r(3),r(4),r(5))
node = new treenode
node.text = r(1)
node.tag = c
for i as integer = 1 to 4
node2 = new treenode
node2.text = r(i)
node.nodes.add(node2)
next
tree.nodes.add(node)
next

now you can use the events of the tree to access your class and manipulate
the data (if you use this you will need to reload the tree)

as i said its 1 way of doing this, i don't like working bound but thats
another option.

hope it helped

eric


[quoted text, click to view]

Cor
11/24/2003 9:40:30 AM
Hi Kisthor,

Data in a treeview has a "Tree" structure, while in datagrid mostly a flat
structure.
What you describe looks for me a flat structure.

So maybe you can better have a look for a "listview" and then in a
combination if that is necessary with the"treeview", then you get the
explorer look.

I hope this helps a little bit?

Cor


[quoted text, click to view]

Cor
11/24/2003 11:48:56 AM
Hi Kishor,

I send you this link from the VB.resource kit, I think that will help you
with this ComponentOne flexgrit. There is a special section about those
components.

http://msdn.microsoft.com/vbasic/vbrkit/default.aspx

Give a sign is this was where you where looking for after investigating it?

Cor

[quoted text, click to view]

Kishor
11/24/2003 12:54:02 PM
Hi,



In Visual basic6 there are so many grids using which we can display the tree
structure (Multiple column). Same thing I am planning to display the result
of query in a tree format, instead of grid. I wanted to know how to convert
this data grid in to a tree view?. I am using vb.net as a development
language. I am having records in this format



ID Colmn1 Colmn2 Colmn3 Colmn4 ParentId.



First column Id and last column ParentId will be not visible to the user.



Please suggest me some kind of solution for this.





Regards

Kishor

Kishor
11/24/2003 4:01:20 PM
Hi,
Thanks for your immediate reply....I think there is some confusion. I am
here sending you a url please see this grid Right Side
http://www.componentone.com/Products/images/net/c1flexgrid/flexnet_category.gif

This is what I want to build using data grid.

Thanks,
Kishor



[quoted text, click to view]

AddThis Social Bookmark Button