By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,551 Members | 2,727 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,551 IT Pros & Developers. It's quick & easy.

Tree view and Datagrid

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
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
"Kishor" <Kp***@hotmail.com> wrote in message
news:OS**************@TK2MSFTNGP10.phx.gbl...
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

Nov 20 '05 #2

P: n/a
Cor
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


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.

Nov 20 '05 #3

P: n/a
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...t_category.gif

This is what I want to build using data grid.

Thanks,
Kishor

"Cor" <no*@non.com> wrote in message
news:eK**************@TK2MSFTNGP12.phx.gbl...
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


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.


Nov 20 '05 #4

P: n/a
Cor
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
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...t_category.gif

Nov 20 '05 #5

P: n/a
Hi,

I am having this component with me but there is a issue of accessibility
with this grid, so I can not use this grid.

This is why I am planning to use data grid which comes free with .net
studio. My problem here is I dont know how to convert this Data grid to
tree.

please tell me if you have any suggestions

Thanks

Kishor

"Cor" <no*@non.com> wrote in message
news:u4**************@TK2MSFTNGP09.phx.gbl...
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
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...t_category.gif


Nov 20 '05 #6

P: n/a
i'm afraid you can't do that w the default datagrid

if i'm not mistaking the grid in the resource kit is from infragistics. They
have newsgroups of their own you could try there.

Eric

"Kishor" <Kp***@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I am having this component with me but there is a issue of accessibility
with this grid, so I can not use this grid.

This is why I am planning to use data grid which comes free with .net
studio. My problem here is I dont know how to convert this Data grid to
tree.

please tell me if you have any suggestions

Thanks

Kishor

"Cor" <no*@non.com> wrote in message
news:u4**************@TK2MSFTNGP09.phx.gbl...
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
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...t_category.gif



Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.