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


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

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Instead of using "this.treeproject.NodeTable", have you tried using "this.treeproject.Nodes", as you do in the "for" statement?


You can also use this.treeproject.Node[Count].Checked to see if it is checked or not.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sydneyguyAuthor Commented:
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


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' :-)

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.