Thursday, 30 April 2015

How to refresh a treeview control

I recent development I have been working on uses a TTreeview control. The underlining classes that relate to the nodes of the control get updated and I reflect the state of the class as dynamic colour of the node text. This state change can happen every few seconds so I wanted to refresh the treeview at least every couple of seconds.

I read a few articles on how to do this but found the treeview would flicker. The best solution I found was simple, when I wanted to refresh just simply call the 'invalidiate' method, at first this did not work until I set the doublebuffered property to true and now it works really well.

2 comments:

  1. Check out Virtual Treeview: http://www.jam-software.com/virtual-treeview/?language=EN

    ReplyDelete
  2. I will have a look at these components, your comment is a bit brief, is this treeview component much better than the standard one, and what are the advantages of this component?

    ReplyDelete