Click here to Skip to main content
15,897,518 members

Comments by Madhukumar N (Top 8 by date)

Madhukumar N 10-Sep-14 6:31am View    
can you please give me the code i have around 5 levels of treenodes. and at the end i need to save the tree structure too if i delete the nodes to get filetered treeview i will be at problem while saving please help.
Madhukumar N 4-Sep-14 4:53am View    
Here is what i Need

I want to just give the level as input and expand that particular level of nodes from the Treeview
Madhukumar N 20-Aug-14 1:45am View    
Thanks for the help but after doing the above i couldn't be able to add child nodes into that node can you help?

The code is
Dim DT As New DataTable()
Dim DT1 As New DataTable()
Dim filter As String = ""
Dim OrderBy As String = ""

Try
DT = DS.Tables(0)
filter = "Branchparent is null"
OrderBy = "TreeOrderInd ASC"
For Each row In DS.Tables(0).Select(filter, OrderBy)
''tl.Nodes.Add(row.Item("BranchID").ToString(), row.Item("BranchName").ToString())
Dim Parenttreenode As New CustomTreeNode()
'Parenttreenode.Nodes.Add(row.Item("BranchID").ToString(), row.Item("BranchName").ToString())
Parenttreenode = tl.Nodes.Add(row.Item("BranchID").ToString(), row.Item("BranchName").ToString())
Parenttreenode.ImageIndex = 0
Parenttreenode.BranchType = ReplacevalueifNull(row.Item("BranchType").ToString(), 0)
Parenttreenode.BranchSubType = ReplacevalueifNull(row.Item("BranchSubType").ToString(), 0)
Parenttreenode.TreeOrderInd = ReplacevalueifNull(row.Item("TreeOrderInd").ToString(), 0)
''1st Tier Node
Dim filter1 = "BranchParent='" & row.Item("BranchID").ToString() & "'"
For Each row1 In DS.Tables(0).Select(filter1, OrderBy)
Dim Childtreenode1 As New CustomTreeNode()
Parenttreenode.Nodes.Add(row1.Item("BranchID").ToString(), row1.Item("BranchName").ToString())
'Childtreenode1 = Parenttreenode.Nodes.Add(row1.Item("BranchID").ToString(), row1.Item("BranchName").ToString())
Childtreenode1.ImageIndex = 1
Childtreenode1.BranchType = ReplacevalueifNull(row.Item("BranchType").ToString(), 0)
Childtreenode1.BranchSubType = ReplacevalueifNull(row.Item("BranchSubType").ToString(), 0)
Childtreenode1.TreeOrderInd = ReplacevalueifNull(row.Item("TreeOrderInd").ToString(), 0)
''2nd Tier Node
Dim filter2 = "BranchParent='" & row1.Item("BranchID").ToString() & "'"
For Each row2 In DS.Tables(0).Select(filter2, OrderBy)
Dim Childtreenode2 As New CustomTreeNode()
Childtreenode2 = Childtreenode1.Nodes.Add(row2.Item("BranchID").ToString(), row2.Item("BranchName").ToString())
Childtreenode2.ImageIndex = 2
Childtreenode2.BranchType = ReplacevalueifNull(row.Item("BranchType").ToString(), 0)
Childtreenode2.BranchSubType = ReplacevalueifNull(row.Item("BranchSubType").ToString(), 0)
Childtreenode2.TreeOrderInd = ReplacevalueifNull(row.Item("TreeOrderInd").ToString(), 0)
''3rd Tier Node
Dim filter3 = "BranchParent='" & row2.Item("BranchID").ToString() & "'"
For Each row3 In DS.Tables(0).Select(filter3, OrderBy)
Dim Childtreenode3 As New CustomTreeNode()
Childtreenode3 = Childtreenode2.Nodes.Add(row3.Item("BranchID").ToString(), row3.Item("BranchName").ToString())
Childtreenode3.ImageIndex = 3
Childtreenode3.BranchType = ReplacevalueifNull(row.Item("BranchType").ToString(), 0)
Childtreenode3.BranchSubType = ReplacevalueifNull(row.Item("BranchSubType").ToString(), 0)
Childtreenode3.TreeOrderInd = ReplacevalueifNull(row.Item("TreeOrderInd").ToString(), 0)
''4th Tier Node
Dim filter4 = "BranchParent='" & row3.Item("BranchID").ToString() & "'"
For Each row4 In DS.Tables(0).Select(filter4, OrderBy)
Dim Childtreenode4 As New CustomTreeNode()
Childtreenode4 = Childtreenode3.Nodes.Add(row4.Item("BranchID").ToString(), row4.Item("BranchName").ToString())
Childtreenode4.ImageIndex = 4
Childtreenode4.BranchType
Madhukumar N 12-Aug-14 5:23am View    
It must be like a property of a all the Nodes the values will change for nodes
Madhukumar N 6-Feb-14 4:56am View    
So how can i code for it so that it will take the selected text??