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
50
Bind UltraTree to DataTable with two levels
posted

Hello!

I searched the forum but didnt really find an answer, hope u can help me:

I have a DataSet like this:

Region      Name

North         Smith

North         Bond

North         Simpson

South         Willis

 

Now i want this displayed in a UltraTree like this:

-North

    -Smith

    -Bond

    - Simpson

-South

    - Willis

 

I do

    ultraTree1.DataSource = myDataTable;

but then i get a tree like

-North

-North

-North

-South

 

I tried other things too, but didnt get the tree like i want it.

 

Parents
No Data
Reply
  • 69832
    Verified Answer
    Offline posted

    You have to create a DataRelation and add it to the DataSet's Relations collection. Once the DataSet is properly structured, you can use the control's SetDataBinding method to assign that DataSet to the DataSource property, and the name of the table that contains the regions to the DataMember property.

Children