Dear All,
I have few question regarding using Treeview in my project. The screen of my project is been attched.
I can populate the data from database in treeview using following code:
Imports System.Data.SqlClient
Public Class Tree
Private Sub Tree_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim dsTest As DataSet
Dim cnTest As New SqlClient.SqlConnection("DATA SOURCE=myPC\DBserver;USER ID=sa;PASSWORD=udo5673;INITIAL CATALOG=ZINDAA;")
Dim daCountry As New SqlClient.SqlDataAdapter("SELECT CsCountryCode,CsCountryName from hrCountrySetup", cnTest)
dsTest = New DataSet()
cnTest.Open()
daCountry.Fill(dsTest, "dtCountry")
cnTest.Close()
TreeView1.Nodes.Clear()
Dim parentrow As DataRow
Dim parenttable As DataTable
parenttable = dsTest.Tables("dtCountry")
For Each parentrow In parenttable.Rows
Dim parentnode As New TreeNode
parentnode = New TreeNode(parentrow.Item(0) & " - " & parentrow.Item(1))
TreeView1.Nodes.Add(parentnode)
Next parentrow
End Sub
End Class
now with my treeview, i want to fill my texbox1,textbox2 with the value of treeview node when user selects the treeview node.
I could get idea on how to. CAN ANYONE HELP ME?