"Binding" to TreeView?

I am trying to create a server / network settings system for my IRC client. Due to the relational nature of networks and servers, I decided to use SQLite to store everything.

My first step is to make a settings dialog, which, as you might expect; TreeView, which contains the network and the server, and the space on the side to edit their settings.

I have little experience with ADO.NET, but just basic selection and updating and nothing relational. So my problem is how to associate a string with a TreeNode. I already have custom TreeNode objects for servers and networks, and all this works well with some manually entered data.

So, it seems to me that I don’t need to “bind” per se, I just need to load the data into the TreeView and easily update the settings.

+3
source share
2 answers

In our projects, we usually use the Tag TreeNode property to bind a string to a TreeNode and manually load the data into a TreeView without binding.

+3
source

The main problem when populating the Treeview is whether you are doing a full load of all the nodes, or are you implementing some kind of lazy loading approach as each node expands.

, 500 , . .

- node BeforeExpand. TreeView +/-, , node , . , node, , ( ) , , node.

, TreeNode node. BeforeExpand() Is.

, node, BeforeExpand, , node, , . node, .

Tag node - /. , . , , , .

+3

Source: https://habr.com/ru/post/1717700/


All Articles