Link to home
Start Free TrialLog in
Avatar of sydneyguy
sydneyguyFlag for Australia

asked on

extracting the node values from treeview using visual studio 2003 working in c#

I wish to cycle through the values in the parent nodes of  a tree view. have all the fields loaded up and that all works fine
am using code
for(int Count = 1 Count < this.treeproject.Nodes.Count;Count++)
{

       what is needed here is the code to dislpay the values in the nodes
      I can see in debuging the code treeproject.NodeTable.buckets[Count].val  which shows me all the values I want to be able to see but

     tried

MessageBox.Show( treeproject.NodeTable.buckets[Count].val)  
when running the code error shows that ""  System.Window.Forms.TreeView.nodeTable '  is inaccessible due to its protection level

in the end all I want to do is to start at the top node and cycle down to the last node parent only and have access to the value and check if it
is checked or not not particular how it gets done just need to access this info

}
thanks for your help I believe this is easy for all smarties out there  gar



ASKER CERTIFIED SOLUTION
Avatar of AGBrown
AGBrown
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sydneyguy

ASKER

very close not perfect but damn close

MessageBox.Show(this.treeproject.Node[Count].Text);  does not run but

MessageBox.Show(this.treeproject.Nodes[Count].Text);  does and gives me access to exactly the data that I want
so thankyou andy for your promptness take my points with my thanks

is there some reason I can see treeproject.NodeTable.buckets[Count].val  which shows me all the values I want to be able to see but
is is inaccessible due to its protection level. even it i want to just read only, or is there just other prefered ways to get the needed info

thanks again  andy.............  garry  well done






Garry,

You can probably see the buckets when you are in quickwatch or something? When you are watching a class you can see a lot of the fields and properties that aren't on the public interface.

Sorry about the 's' :-)

Andy