TreeView Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a tree view with a few nodes, an example is illustrated below:

Customer Info.
Ticket History
Misc. Notes

The TreeView is on the left hand. I have figured out which node is selected by using the e.Node.Text property. Now what I would like to do is to be able to display the appropriate information (which will appear on the right hand side of the widnows form) that the user has selected on the TreeView. For example, if the user selects the Ticket History, the user will then be able to see a ticket history for the customer on the right hand side of the Windows Form.

My question is what is a good way to implement this? I want to have something similar to a TabPage such as that a user clicks on a TabPage he/she will see the appropriate info on that tab page!

Does anyone out there have any information as to how I can acheive this? Any advice, example or links on the net will be greatly appreciated!
 
I have just done this myself. What I did was:
1) Derive classes from TreeNode. One class for each "type" of node (i.e.
customer, misc, etc.). Then you can determine node type selected with "as"
or "is".
2) Your derived type can contain other fields/properties, so you can add
arraylist, arrays, etc.
3) Then when your node is selected, just add the array items to the
listview.

--
William Stacey, MVP

Ed_P. said:
Hello,

I have a tree view with a few nodes, an example is illustrated below:

Customer Info.
Ticket History
Misc. Notes

The TreeView is on the left hand. I have figured out which node is
selected by using the e.Node.Text property. Now what I would like to do is
to be able to display the appropriate information (which will appear on the
right hand side of the widnows form) that the user has selected on the
TreeView. For example, if the user selects the Ticket History, the user
will then be able to see a ticket history for the customer on the right hand
side of the Windows Form.
My question is what is a good way to implement this? I want to have
something similar to a TabPage such as that a user clicks on a TabPage
he/she will see the appropriate info on that tab page!
Does anyone out there have any information as to how I can acheive this?
Any advice, example or links on the net will be greatly appreciated!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top