Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1225
How to set UltraTree Control?
posted

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 P
ON 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.


Parents
No Data
Reply
  • 53790
    Suggested Answer
    posted

    Hello Eros,

     

    There are different approaches to achieve the desired behavior. The first one is to split your query with Inner join to two different queries, without inner join. The first one will be select from your Categories table – Parent table, and second query (from Products) will be your child table. You could include both tables (the result set from your two queries) in DataSet.  Then you could create a  Relation between both tables using the same connection like it is in your Inner join.

    Other approach could be by  using directly the result set from your inner join (please note that by this was you will have duplicate items in your Categories table).  I made small sample that shows the second approach. Please take a look at the attached sample for more details. Please let me know if you have any questions.

    Regards

    UltraTreeDataBindingFromInnerJoin.zip
Children