S
S
sitev_ru2019-04-02 11:16:59
C++ / C#
sitev_ru, 2019-04-02 11:16:59

Why is TreeView slow?

With a large number of tree branches, my TreeView starts to slow down, or rather, the usual operation of assigning a branch name:
treeView1.SelectedNode.Text = "hello!";
I'm testing on different computers. This operation can take from 100 ms to 1 second with 35 thousand branches. If more, then the time increases proportionally. Can this problem be solved?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Proskurin, 2019-04-02
@Vlad_IT

For the TreeView, WPF has virtualization that allows the container to create only those elements that are in the scroll visibility call. For Windows Forms, there is no such thing, and therefore all elements are processed. You need to write your own control, as far as I understand.

P
Peter, 2019-04-02
@petermzg

If you have a standard Windows TreeView. That is, you use WinForms.

treeView1.BeginUpdate();
// тут код ваших изменений
treeView1.EndUpdate();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question