Treeview question

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi all,

I have a puzzling question. I'm loading a treeview conrol with nodes and now
need to send data with it but for it not to be shown. I need to use it
later. To give an example, a datagrid could have one visible column but a
couple of invisible columns with supporting data (e.g. a db key). If someone
clicks on the description, one can get that key from the hidden item.

Is there some way I can do this using the treeview control? I know I can
record the index as I create the child nodes and then store it in a session
variable and then use it later in the SelectedIndexChange event but I was
wondering if there was a more-elegant method.

Any help is appreciated . . .

Regards
John.
 
Your post went unanswered. Have you resolved this issue? If you still need
help, please post the original question with your request.
 
Weird. You have the original post in each of your posts. Is there some reason that was not enough to give a pertinent response?

--
George Hester
__________________________________
Alvin Bruney said:
Your post went unanswered. Have you resolved this issue? If you still need
help, please post the original question with your request.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
John said:
Hi all,

I have a puzzling question. I'm loading a treeview conrol with nodes and now
need to send data with it but for it not to be shown. I need to use it
later. To give an example, a datagrid could have one visible column but a
couple of invisible columns with supporting data (e.g. a db key). If someone
clicks on the description, one can get that key from the hidden item.

Is there some way I can do this using the treeview control? I know I can
record the index as I create the child nodes and then store it in a session
variable and then use it later in the SelectedIndexChange event but I was
wondering if there was a more-elegant method.

Any help is appreciated . . .

Regards
John.
 
The more elegant method is to store the key item in the value portion of the
treeview node object
treeview.nodes.selectedvalue = key. this treeview only shows the nodes.text
property and so the value property remains hidden.

the reason for asking for a repost of the original question is that if users
use other sites to post a question to this newsgroup, it isn't necessarily
carried forward in the reply and so i would have to make a second request
asking for the original post (since it would not be avaible) instead of
responding to the question. One such example is post replies from devdex.com

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Weird. You have the original post in each of your posts. Is there some
reason that was not enough to give a pertinent response?

--
George Hester
__________________________________
Alvin Bruney said:
Your post went unanswered. Have you resolved this issue? If you still need
help, please post the original question with your request.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
John said:
Hi all,

I have a puzzling question. I'm loading a treeview conrol with nodes and now
need to send data with it but for it not to be shown. I need to use it
later. To give an example, a datagrid could have one visible column but a
couple of invisible columns with supporting data (e.g. a db key). If someone
clicks on the description, one can get that key from the hidden item.

Is there some way I can do this using the treeview control? I know I can
record the index as I create the child nodes and then store it in a session
variable and then use it later in the SelectedIndexChange event but I was
wondering if there was a more-elegant method.

Any help is appreciated . . .

Regards
John.
 
Well thank you for answering my question and not taking it as a crticism. I was wondering why you were doing this and you answered it thoughtfully. Thank you.

--
George Hester
__________________________________
Alvin Bruney said:
The more elegant method is to store the key item in the value portion of the
treeview node object
treeview.nodes.selectedvalue = key. this treeview only shows the nodes.text
property and so the value property remains hidden.

the reason for asking for a repost of the original question is that if users
use other sites to post a question to this newsgroup, it isn't necessarily
carried forward in the reply and so i would have to make a second request
asking for the original post (since it would not be avaible) instead of
responding to the question. One such example is post replies from devdex.com

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Weird. You have the original post in each of your posts. Is there some
reason that was not enough to give a pertinent response?

--
George Hester
__________________________________
Alvin Bruney said:
Your post went unanswered. Have you resolved this issue? If you still need
help, please post the original question with your request.

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
John said:
Hi all,

I have a puzzling question. I'm loading a treeview conrol with nodes and now
need to send data with it but for it not to be shown. I need to use it
later. To give an example, a datagrid could have one visible column but a
couple of invisible columns with supporting data (e.g. a db key). If someone
clicks on the description, one can get that key from the hidden item.

Is there some way I can do this using the treeview control? I know I can
record the index as I create the child nodes and then store it in a session
variable and then use it later in the SelectedIndexChange event but I was
wondering if there was a more-elegant method.

Any help is appreciated . . .

Regards
John.
 
Back
Top