Home > Net >  "" problem about grading load in the treeview
"" problem about grading load in the treeview

Time:09-27

The public Function NodeLevel (ByVal n As TreeNode) As Byte
'* find out the current node of the tree series
Dim I As Byte=1
'Dim m As String
Do Until Nancy (polocy) pelosi arent Is Nothing
N=Nancy (polocy) pelosi arent
I=I + 1
Loop
The Return of I
End the Function
Private Sub TreeView1_AfterSelect (sender As Object, e As TreeViewEventArgs) Handles TreeView1. AfterSelect
Dim SQLDB As New SQLDataBase (strConnect)
Dim strTable As New DataTable
Dim strProjectID As String=Split (SelectNodeID, "_") (1)

Select Case NodeLevel e.N (ode). ToString
Case "1"
If e.N ode. GetNodeCount (False)=0 Then
StrTable=SQLDB. ExecuteSQLToDataTable (" Select * from tb_Matching_Region where Project_ID='" & amp; StrProjectID & amp; "'")
For I As Integer=0 To strTable. Rows. The Count - 1
Dim tree_leaf As New TreeNode ()
Tree_leaf. Tag=strTable. Rows (I) (" Matching_Region_ID "). The ToString ()
Tree_leaf. Text=strTable. Rows (I) (" Matching_Name "). The ToString ()
TreeView1. SelectedNode. Nodes. The Add (tree_leaf)
Next
End the If
Case "2", "
If e.N ode. GetNodeCount (False)=0 Then
StrTable=SQLDB. ExecuteSQLToDataTable (" Select * from tb_Matching_Part where Matching_Region_ID='" & amp; E.N ode. Tag & amp; "'")
For I As Integer=0 To strTable. Rows. The Count - 1
Dim tree_leaf As New TreeNode ()
Tree_leaf. Tag=strTable. Rows (I) (" Matching_Part_ID "). The ToString ()
Tree_leaf. Text=strTable. Rows (I) (" Part_ID "). The ToString ()
TreeView1. SelectedNode. Nodes. The Add (tree_leaf)
Next
End the If
End the Select
End Sub
Above belong to hierarchical load function, but there is a problem, just don't show "+", just click on the content of a node to know whether the next level, how to automatically load sub level plus

CodePudding user response:

Enclosing treeView1. Nodes. The Clear ();
This. TreeView1. BeginUpdate ();

CodePudding user response:

It doesn't seem to solve
  • Related