FMX Treeview: How to reorder TTreeviewItem


Imagine an FMX TTreeview with one ParentNode showing three ChildNodes.

I need to move the last childnode to the first position in that list of three childnodes. ParentNode.Exchange( LastChildNode, FirstChildNode ) works.

However, that will not work in a drag-drop operation. One would expect that ParentNode.InsertObject( 0, LastChildNode ) would work. But when using InsertObject, LastChildNode stays on its original location. Tracking into the FMX source did not provide me any clues why this does not work.

Does anyone know how to best move a node to a new location in the list of sibling nodes?

Comments are closed.