Topic: TreeView

As far as I could see, treeview doesn't support drag n drop of tree items [nods].


Is there any way to move tree items up and down and within levels [childs from one parent to another]?

Adam
God... please help me become the person my dog thinks I am.

2 (edited by k245 2019-05-28 10:55:28)

Re: TreeView

Please, read the article about edit tree structure:

https://vk.com/@createmyvisualdatabasea … row-a-tree

Link to project at the end of the article

Визуальное программирование: блог и телеграм-канал.

Re: TreeView

Hi k245,


Thanks for the reply.


As far as I could understand, your project script is for delphi, I was looking answers for MVD.

Adam
God... please help me become the person my dog thinks I am.

4 (edited by k245 2019-05-29 05:14:56)

Re: TreeView

Article and scripts exclusively for MVD  )))


To change the branch in which the element is located, use the "Parent" drop-down list (3). To move an element within a branch, use the "Down" (1) and "Up" (2) buttons.


https://pp.userapi.com/c851232/v851232028/139065/R1qG-Rwpt_0.jpg


This article describes the scripts for editing the tree, in particular the procedure MoveTreeItem (ATable: string; ATree: TdbTreeView; AOrderNumCol: integer; ADown: boolean) ;.


The structure of the table with the tree is described here: https://vk.com/@createmyvisualdatabaseapp_en-menu

https://pp.userapi.com/c846322/v846322722/2022dc/V4d7DlWkHQg.jpg


Direct link to the MVD project download:https://drive.google.com/file/d/1dRWfgy … Rzrvm/view

Визуальное программирование: блог и телеграм-канал.

Re: TreeView

AD1408 wrote:

As far as I could understand, your project script is for delphi, I was looking answers for MVD.

I wrote a series of articles on creating applications in MVD. You may be interested to read the articles in chronological order: https://vk.com/@createmyvisualdatabasea … rogramming

Визуальное программирование: блог и телеграм-канал.

Re: TreeView

I just wanted a working MVD example project showing how to move treeview items.

Adam
God... please help me become the person my dog thinks I am.

Re: TreeView

MVD Treeview component:
Could somebody produce a sample project with a script that enables user to move tree nods please?

Adam
God... please help me become the person my dog thinks I am.

Re: TreeView

Hi Adam,
Are you trying to move things in the Tree so that they are sorted alphabetically or are you wanting to move child nodes to a different parent node?
Derek.

Re: TreeView

Hi Derek,


Both... On sorting part, not alphabetically or numerically, freewill, custom ordering.

Adam
God... please help me become the person my dog thinks I am.

Re: TreeView

Hi Dmitry,


Any solution for moving three nods via button click, since drag n drop is not possible?

Adam
God... please help me become the person my dog thinks I am.

Re: TreeView

Hi Adam,
Drag and drop is actually supported (see screen capture), although note that it doesn't drag child nodes with it (which may or may not be what you want).
But the real problem is saving the node in its new place in the structure.   Saving re-sorted nodes alphabetically within the structure isn't a problem but you mentioned in an earlier post that you wanted to do it 'freehand' and that, as far as I understand it, is a different matter altogether.  I can't think of a straightforward way of doing it - I wondered if it might have been possible using 'autoincrement' but I believe it's only supported with tablegrids and not treeviews.
Derek.

Post's attachments

Attachment icon move nodes.jpg 294.58 kb, 166 downloads since 2019-06-05 

Re: TreeView

Thank you very much Derek...........


I was looking for some real treeview functionality, at least moving main and child nodes keeping them at their moved places until moved again.


Lets see if Dmitry can offer any solution.

Adam
God... please help me become the person my dog thinks I am.

Re: TreeView

?

Adam
God... please help me become the person my dog thinks I am.