Dear all!
I am trying to code a 2-level UltraTree, but the Control is always empty.
Please Review my code, maybe I am missing something:
SQLstr = " SELECT DISTINCT vs_IMS_Companies.ShortText, vs_IMS_Companies.CompanyID - 100 as CompanyID"
SQLstr += " FROM t_M_Employee INNER JOIN"
SQLstr += " vs_IMS_Companies ON t_M_Employee.CurrentIMSCompany = vs_IMS_Companies.CompanyID"
DS = IMS_Core_Class.mdl_DataHandling.MakeDataset(SQLstr, "A1", IMS_ED_Class.m_DataHandling.ConnString_Master)
SQLreader = DS.CreateDataReader
Do While SQLreader.Read
Me.UltraTree1.Nodes.Add(SQLreader("CompanyID"), SQLreader("ShortText"))
Loop
SQLreader.Close()
DS = New DataSet("A2")
SQLstr = " SELECT t_M_Employee.EmployeeID, t_M_Employee.LastName + ' ' + t_M_Employee.FirstName AS EmployeeName, vs_IMS_Companies.CompanyID -100 as CompanyID"
DS = IMS_Core_Class.mdl_DataHandling.MakeDataset(SQLstr, "A2", IMS_ED_Class.m_DataHandling.ConnString_Master)
ParentNode = Me.UltraTree1.Nodes(SQLreader("CompanyID").ToString)
ParentNode.Nodes.Add(SQLreader("EmployeeID"), SQLreader("EmployeeName"))
Doing a quickwatch I see that all nodes are correctly added, but the control Show nothing.
Any idea?
P.S.: I had also played with datarelations, but no way ......
Found a solution, thx