Hello friends,
Please I need your help, I have this Query:
SELECT c.CategoryID , p.ProductID , c.CategoryName , p.ProductName FROM Categories as C INNER JOIN Products as PON c.CategoryID = p.CategoryID
I need to show a tree with the head of the Parent Category table and within the detail of the Product table.
Please friend, any idea?
Thanks, God Bless you.
Thanks for all. That the force with be you.
Regards
Hello Eros,
Could you please take a look at the latest modification in my sample. Please let me know if you have any questions.
Hello, thanks for replying, I tried your example and I've added 3 more products and the UltraTree control is displayed like my results, please how I can fix this.
dt.Rows.Add(0,"cCategoryName 0","cCategoryDesc 0", 0, 0, "pProductName 0"); dt.Rows.Add(1, "cCategoryName 1", "cCategoryDesc 1", 1, 100, "pProductName 100"); dt.Rows.Add(1, "cCategoryName 1", "cCategoryDesc 1", 1, 101, "pProductName 101"); dt.Rows.Add(1, "cCategoryName 1", "cCategoryDesc 1", 1, 102, "pProductName 102"); dt.Rows.Add(2, "cCategoryName 2", "cCategoryDesc 2", 2, 103, "pProductName 103"); dt.Rows.Add(3, "cCategoryName 3", "cCategoryDesc 3", 3, 104, "pProductName 104"); dt.Rows.Add(4, "cCategoryName 4", "cCategoryDesc 4", 4, 105, "pProductName 105"); dt.Rows.Add(1, "cCategoryName 1", "cCategoryDesc 1", 1, 106, "pProductName 106"); dt.Rows.Add(2, "cCategoryName 2", "cCategoryDesc 2", 2, 107, "pProductName 107"); dt.Rows.Add(3, "cCategoryName 3", "cCategoryDesc 3", 3, 108, "pProductName 108");
Could you please take a look at the attached sample, and please feel free to modify my sample to reproduce your issue and revert it back to me. I`ll be glad to research the issue for you. Please let me know if you have any quesitons.
Please, my UltraTreeView are grouped by product and within the list of categories.
This is my Code from Initialize the UltraTree
If (e.Node.Level = 0 And OldValue <> e.Node.Cells("cCategoryID").Text) Then e.Node.Cells("cCategoryID").Column.Visible = True e.Node.Cells("cCategoryName").Column.Visible = True e.Node.Cells("cDescription").Column.Visible = True e.Node.Cells("pProductID").Column.Visible = False e.Node.Cells("pCategoryId").Column.Visible = False e.Node.Cells("pProductName").Column.Visible = False e.Node.Visible = True ElseIf (e.Node.Level = 1) Then e.Node.Cells("cCategoryID").Column.Visible = False e.Node.Cells("cCategoryName").Column.Visible = False e.Node.Cells("cDescription").Column.Visible = False e.Node.Cells("pProductID").Column.Visible = True e.Node.Cells("pCategoryId").Column.Visible = True e.Node.Cells("pProductName").Column.Visible = True Else e.Node.Visible = False End If OldValue = e.Node.Cells("cCategoryID").Text