In my form I implemented a function that moves a tree node in a TcxDBTreeList one level up. I do it like that:
if treeList.FocusedNode.Level > 0 then
treeList.FocusedNode.MoveTo(treeList.FocusedNode.Parent, tlamAdd );
This works fine except that the change isn't persisted. That means the next time I open the tree list the moved node is back where it was before the move. Also when I move a node and immediately after that I insert somewhere in the tree list a new node the moved node is instantly moved back again.
Do I have to trigger the underlying data set in some way after the move that the tree has changed and that I want that change to be persisted?
I use FIBPlus database controls and I already set AutoCommit to True. So I am not sure if it's a problem with your controls or with the FIBPlus controls. Since adding a tree node works fine I thought there is something that I forgot to call in the tree list control.
Regards,
Dirk.
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Dirk,
Thank you for the message.
This behavior is by design. The MoveTo procedure doesn't change the parentID field's values; it reorders nodes at the level of the TreeList.
If you want save the new nodes order, you should change the corresponding values in the dataset.
For more information, please read the (How to reorder TdxDBTreeList nodes via drag-and-drop) Knowledge Base Article.
Thanks,
Valdemar