How can I export or save treeview layout

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 1 year and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
ataveras
Posts: 2
Last visit: Wed Sep 13, 2023 7:44 am

How can I export or save treeview layout

Post by ataveras »

working on a tool with customized treeview component. Anyone know how to save and re-import the treeview module?

Thanks.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: How can I export or save treeview layout

Post by jvierra »

What is a Treeview layout? The PSF file contains the forms controls layout. If you want to save the contents of a control, you can just write it to a file. You will have to decide how you would design a file to match your layout. I suggest that an XML file would be the best choice as it is hierarchical like a tree.
ataveras
Posts: 2
Last visit: Wed Sep 13, 2023 7:44 am

Re: How can I export or save treeview layout

Post by ataveras »

I've created a simple tool that leverages the treeview module. I would like to save the treeview layout on demand so the treeview layout can be reapplied the next time the app is launched. My problem is I don't know how to save the treeview layout and my searching hasn't yielded much.
treeview.jpg
treeview.jpg (23.43 KiB) Viewed 1096 times
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: How can I export or save treeview layout

Post by jvierra »

The layout is the way the TreeView is displayed. You will have to save both the data and the visual attributes of the control. You can do this with an XML file. I see no other way to do this.

Save all data and the visual properties of the control then read them back and create each node as specified in the XML file.
nelsonzop
Posts: 2
Last visit: Mon Sep 12, 2022 6:54 am

Re: How can I export or save treeview layout

Post by nelsonzop »

yea it can be saved as XML, XML file would be the best choice as it is hierarchical like a tree.
nelsonzop
Posts: 2
Last visit: Mon Sep 12, 2022 6:54 am

Re: How can I export or save treeview layout

Post by nelsonzop »

The PSF file contains the forms controls layout. techzpod download mobdro
This topic is 1 year and 6 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked