Roz Clarke
roz.clarke at donnslaw.co.uk
Thu Feb 12 04:40:24 CST 2004
Hiya Does anyone have any code for recursively populating a treeview control? I have a table like this: TaskID ParentID Description 1 0 fleg 2 1 subfleg a 3 1 subfleg b 4 2 sub-subfleg a and so on. I don't want to limit the number of levels. I can see that I need to run through the dataset and populate the treeview with the first level, then do it again n times until all the children are added at the appropriate level, skipping any record already added as a node. I'm in a hurry - I have 2 hours to nail this (working hours not real-time) so although it feels lazy and I would love to crack this on my own, if anyone has done it before I would appreciate any help you can give. TIA Roz