Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
130
refresh() after updates in listview necessary?
posted

Hi,

I have built a form with an ultratreeview and an ultralistview. On mouseup on an active node the listview is updated. I have more events defined on the treeview like mousedown and mousemove. It seems necessary to use the refresh method on the listview after the update is done, otherwise the updates are sometimes shown after a remarkable period of time or after a mousemove. Is this use of the refresh method some sort of  "known good practise"? 

Parents
No Data
Reply
  • 69832
    Suggested Answer
    Offline posted

    UltraListView automatically updates itself when (for example) a relevant property changes, or when you repopulate it. Assuming by a "remarkable" period of time you mean more than a few milliseconds, I'm not sure what is causing that, unless by chance you are inadvertantly supressing painting by calling BeginUpdate on the control. If you can, post a simple sample and we can take a look.

    The Refresh method invalidates the entire control and then sends a WM_PAINT message to it, causing the entire control to be repainted. This can have performance ramifications if you use it frequently, but if you call it (for example) after repopulating the entire control, I would consider that to be a valid use of it. As I stated in the previous paragraph, however, it should not be necessary.

Children