Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamic treeviews- updating nodes

Status
Not open for further replies.

RMasters

Programmer
Nov 14, 2000
36
0
0
GB
I am building a treeview from 4 data-adapters combined into a single dataset (from SQL Server). This works fine and I get 4 levels of tree nodes. My problem is that the fourth level of nodes needs to be dynamic (all the others are static after initial load). I want to reload the final tier without having to reload the entire dataset and rebuild the treeview (obviously reloading would collapse all the nodes etc- and look a bit rubbish).

Many thanks in advance

Rick
 
Hi RJMasters
Well i have done the similar kind of thing when building the Tree from XML and so logic will be same what i did
is
Step 1) Delete All the Last level Child Nodes in XML before buidling the tree
Step 2) On any event say on Form Load or any other event insert the Child Node at specific position in XML
Step 3) Rebuild the Tree from that XML

Step 1) DeleteAllChildNodesFromXMLFile("..\CONFIGURATION\OGATree.xml")
Here is the technique which i did

Step 2)
For i = 0 To objdtFCC.Rows.Count - 1
AddNodeInXMLFile("..\CONFIGURATION\OGATree.xml", "FCC", "Item" & objdtFCC.Rows(i)("FCCN_LineNo"), objdtFCC.Rows(i)("FCCN_LineNo"), "2")
Next

Step 3)
'trv_OGA is tree View
trv_OGA.LoadTreeViewFromXML("..\CONFIGURATION\OGATree.xml")

So i always have the dynamic tree and i just have to do the Step 1) initially and Step 2) and Step 3) whenever i want it
Regards
Nouman

Nouman Zaheer
Software Engineer
MSR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top