I have a single table with a hierarchy inside. I am using ActiveRecord. How can I convert this into a hierarchic collection that I can then bind to a WinForms or WPF treeview?
Thanks.
ID Name ParentID
1 ALL 1
2 ARGENTINA 1
15 AUSTRALIA 1
16 NW 15
17 BLACKTOWN 16
18 CORLETTE 16
19 PRIMBEE 16
20 TWEED HEADS 16
21 QL 15
22 ASHMORE 21
23 ROBERTSON 21
24 TOOWOOMBA 21
25 TRINITY BEACH 21
26 UNITED STATES 1
27 AK 26
28 CA 26
29 NJ 26
30 NIKISKI 27
31 AMADOR CITY 28
32 MOSS BEACH 28
33 Essex 29
34 Newark 33
35 Ampere 33
36 Avondale 33
37 Beaufort 33