Advertisement

03.08.2008 at 07:27PM PST, ID: 23226124
[x]
Attachment Details

TreeNode and Tag Property

Asked by _Jason_ in C# Programming Language, Microsoft Visual C#.Net

I am trying to figure out how to do the following.

I have a treeview, each child node will display a list of data in a listview when the node is clicked on.  My problem is I don't know how to store more than one class or struct to a treenode.  Lets say I have the following information.

public class ListViewData
{
      public string name = "";
      public string address = "";
      publc string phone = "";
      public string state = "";
      public string zip = "";
}

Lets say for a selected treenode I have added in 10 or more records into the listview, but I will only show maybe the name and phone properties.  Now that specific treenode will be pointing to those 10 records.  How do I add the records into the Tag property of the node so that when I dbl-click on a listview item the correct record will be pulled from the node and popup in a window?

As I said before I know how to store one class or struct per node tag when I create the node, but I don't know how to store multiple structs per node tag.

Even after you store all the records per node tag, how would you access them?  I am sure I am missing out on a bit of information, but it will come to me as I struggle more.


Thanks for any help.Start Free Trial
[+][-]03.10.2008 at 06:26AM PDT, ID: 21086102

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C# Programming Language, Microsoft Visual C#.Net
Sign Up Now!
Solution Provided By: TheLearnedOne
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.23.2008 at 05:23PM PDT, ID: 21851563

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 07:22PM PDT, ID: 21888969

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628