hrvica5
asked on
delphi sorting, treeview
I have table (attach) like this i should sorted in treeview
how should I put it in attach
if ParentID is null that row is firstnode in treeview
if row has ParentId then it is under same id
Thx, Hrvica
sort.xls
how should I put it in attach
if ParentID is null that row is firstnode in treeview
if row has ParentId then it is under same id
Thx, Hrvica
sort.xls
ASKER
Thank you very much for soultions but I have 2 problems
TUC is ok,
but under first node BRE, it is not OK (treeview.jpg)
2. If I have more than cca. 1000 rows it is slow (duration.jpg)
Thank you very much and sory, Hrvica
TreeView.jpg
duration.jpg
TUC is ok,
but under first node BRE, it is not OK (treeview.jpg)
2. If I have more than cca. 1000 rows it is slow (duration.jpg)
Thank you very much and sory, Hrvica
TreeView.jpg
duration.jpg
I see why you needed the AbsoluteIndex for...
But one thing to consider, of course depending on what you are doing, there might be better solution for storing/retrieving nodes to/from DB Tables.
For instance you could use SaveToStream and LoadFromStream to put/get your nodes back and forth from the DB.
If you need to populate the TreeView from the DB line by line, well for big number of records, "you can negotiate your tax but you can not get exempted". There is no way that you can eliminate the time overhead (reading the lines to plot them in the TreeView takes time). Could be reduced but it can't be eliminated completely.
But one thing to consider, of course depending on what you are doing, there might be better solution for storing/retrieving nodes to/from DB Tables.
For instance you could use SaveToStream and LoadFromStream to put/get your nodes back and forth from the DB.
If you need to populate the TreeView from the DB line by line, well for big number of records, "you can negotiate your tax but you can not get exempted". There is no way that you can eliminate the time overhead (reading the lines to plot them in the TreeView takes time). Could be reduced but it can't be eliminated completely.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you, Hrvica
http://www.experts-exchang
Searching in tree is going with strings and not integer value.