I'm pulling a column of information from a database thru odbc. The column will have numbers in it ranging from 1 to 9999999. I want to be able to organize the values into a treeview with up to 3 levels (parent, child, and grandchild) in the following way:
ideal structure would be: AAABBCC
parent: AAA0000
child: AAABB00
grandchild: AAABBCC
however if the level above doesn't exist then the value moves up in a level. For example, assuming that the data contains the following {1, 101, 200, 204, 1200, 1205, 1304, 290000, 291500, 291502,410204}
-- 1
-- 101
-- 200
------- 204
--1200
-------1205
--1304
--290000
--------291500
----------------291502
--410204
Any help would be greatly appreciated.
Mark