Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am populating a tree with information from a dataset populated by an XML file.

 

The xml sheet contains the columns as follows:

 

MainNumber

DocumentName

Index

 

Basically when the treeview is loaded the MainNumber would be the parent and the DocumentName would be the children of the parent. My problem is that this can be updated, when the user clicks on a child node information fills 2 textboxes the MainNumber and the DocumentName. The user can make changes and then commit it to the XML. My question is can I load the index value with the DocumentName without user seeing the index. So I can guarantee that I update the correct information since the index is guaranteed to be unique whereas the other 2 aren't. This application is written in Visual Basic.NET. Any help offered is greatly appreciated.

Posted

If I understand what you are asking, for this to work, you'll need to set the HideSelected property on the treeview to false. That will keep the selected node selected once the treeveiw loses focus. Then in the function you will use to accept the user's changes (probably a button click or something) you'll simply get the SelectedNode from the treeview and set the text to whatever it needs to be set to (and optionally save any XML, though you could do that later if you wanted too). Since it looks like you'll be changing several things at the same time, you can get the parents, children, or siblings of that node and modify or update accordingly. Some more information on TreeNodes.

 

Does this help at all?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...