G
Guest
I've got a treeview that works great. I'm now attempting to add a sorting
(move up/down) functionality within the tree. When the nodes are loaded,
they are loaded in accordance with a Sort_Order field in the underlying
database.
I have added several command buttons (move up, move down) to my form, and
the code behind these buttons is working properly to renumber the sort_order
field in the dataset. When I refresh the text property of the nodes (it
starts with the sort_order field formatted as 2 digit text), the text changes
as appropriate, although the items stay in the same position they were in in
the tree (despite having the tree controls "Sorted" property set to true).
I have added code to remove these two nodes whose position is being changed,
but cannot figure out how to insert the new nodes back in the proper sequence.
Any body have any recommendations? Would selecting the key from the
previous sibling and then using the tvwNext relationship result in an insert?
(move up/down) functionality within the tree. When the nodes are loaded,
they are loaded in accordance with a Sort_Order field in the underlying
database.
I have added several command buttons (move up, move down) to my form, and
the code behind these buttons is working properly to renumber the sort_order
field in the dataset. When I refresh the text property of the nodes (it
starts with the sort_order field formatted as 2 digit text), the text changes
as appropriate, although the items stay in the same position they were in in
the tree (despite having the tree controls "Sorted" property set to true).
I have added code to remove these two nodes whose position is being changed,
but cannot figure out how to insert the new nodes back in the proper sequence.
Any body have any recommendations? Would selecting the key from the
previous sibling and then using the tvwNext relationship result in an insert?