I am very new to WinTree.
My project has a UserControl tree I have been able to code the creation of the tree with static parent and child nodes.
Basicly useing:
Dim treeBatchNav As UltraTree Dim node As UltraTreeNode Dim childNode As UltraTreeNode treeBatchNav = New UltraTree With treeBatchNav
node = .Nodes.Add("Claim Node 1 TEST") 'Claim Number ' Add some child nodes for claim pages. childNode = node.Nodes.Add("Page node 1TEST") 'Claim Page childNode = node.Nodes.Add("Page node 2TEST") 'Claim Page childNode = node.Nodes.Add("Page node 3TEST") 'Claim Page childNode = node.Nodes.Add("Page node 4TEST") 'Claim Page ' Add root nodes for claim numbers node = .Nodes.Add("Claim Node 2TEST") 'Claim Number End With group.Container.Controls.Add(treeBatchNav)
Now I want to create these based off of a datasource well two if I can.
I have a tableadapter that lists claim numbers. For each claim number that is returned I want that to be a parent node.
Under each Parent node. I would like to reach out to a second tableadapter that has the pages listed.I would create a child Node for each page. (I can hard code the pages if I have too.)
So this is what I envision but can not find help on hardcoding datasources in VB.
With treeBatchNav With claimdatasource whilenot eof node = .Nodes.Add(claimnumbercolumnvalue) 'Claim Number With pagedatasource whilenot eof childNode = node.Nodes.Add(pagecolumnvalue) 'Claim Page move.next End With move.next End WithEnd With
I am guessing completely off base on how to even acomplish this. Please point me to the appropriate help documents or help me out here.
It was 0 row count, but that is because all along I had the variables to fill my tableadapter backwords.
Fix now thanks
Declare a local integer variable and see how many rows there in that tabels.
There should be some property tables(index).rows.count.
May be the number of rows returned from the database are zero.
Then it wont even go through For Next loop.
-Best.
Even using the table name instead of index integer it skips past "next" (does not hit: Dim wfNode As New UltraTreeNode )
Odd development here. Not sure if it will help you to understand what I messed up.
Me.CA_ProdDataset.Tables(0) is tbl_Batches
Me.CA_ProdDataset.Tables(1) is tbl_Members
Me.CA_ProdDataset.Tables(11) is tbl_Prod_UMCN_Pages ' This is my child node table.
Still dont know where my tbl_Prod_UMCN_Flags is loading too.
When I go thru tables 2 thru 10 via the code below it skips right past that Next
For Each dr As DataRow In Me.CA_ProdDataSet.Tables(2).Rows
Because in my onload of the forum I have this table loaded into the same datasource
'' From Public Sub frm_Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Tbl_MembersTableAdapter.FillByNotRemoved(Me.CA_ProdDataSet.tbl_Members)
AND I have this table loaded into the same data source.
frm_Main.Tbl_BatchsTableAdapter.FillByNotCompleted(frm_Main.CA_ProdDataSet.tbl_Batchs, assignedto, False) ''From a Module hence the frm_Main. instead of Me.
These are the two tables its loades as table 0 and 1