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
2306
How to? hierarchycal Datarows from a dataset into a treeview
posted

 

Hello!

i have a DataSet with this tables.

How can i load this data into a treeview instead of looping through all these tables and creating nodes?

basically i have one row from P table which must be the root node of the treeview, so only one root node, then i have n A rows that belongs to the P row(this is done by the table pToA) and the F table describes how A rows are child of each one.

 

Thank you

 

Thank you.

Parents
No Data
Reply
  • 69832
    Offline posted

    I'm not clear on why you need the 'PtoA' table...it would seem you just need a 'ID_P' field in table 'A', which contains a value which relates to the 'ID_P' field in table 'P' (similarly to the way the 'ID_A' field in table 'F' relates to a record in table 'A'). In any case, once you have the data structured properly and relations defined, you assign a reference to the DataSet to the control's DataSource property.

Children