Images not updated until scrolling

3 posts, 0 answers
  1. Kristoffer
    Kristoffer avatar
    158 posts
    Member since:
    Dec 2012

    Posted 13 Feb 2013 Link to this post

    I'm adding all my nodes in the NodesNeeded event. Then, in the NodeFormatting event, I'm changing the image of the nodes using the ImageKey.

    The problem is that NodeFormatting is not called for all visible nodes. It seems it gets called for arbitrary root nodes when I expand one of the roots or when I scroll up and down. What's going on?

    UPDATE
    If I explicitly set the ImageKey when adding the nodes (which I don't want to do), then all images are updated when I click inside the tree view. Calling Refresh() after adding the nodes does not help.

    UPDATE 2
    Another problem...
    when I double-click node A its icon changes to "Open" and is kept open until I select one of its child nodes. When a child is selected, the icon changes to "Closed". I have put breakpoints at all places where I set the icon to "Closed" and it does not fire. Hence, for some reason, the RadTreeView manages to revert the icon to its previous state...
  2. Kristoffer
    Kristoffer avatar
    158 posts
    Member since:
    Dec 2012

    Posted 13 Feb 2013 Link to this post

    Ok, I found the problem. I added my image list in my form's Load event handler. That seems to be too late. Moving it to the constructor solved the problem.

    And, I would argue that this piece of information should be present in your documentation.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 18 Feb 2013 Link to this post

    Hi Kristoffer, 

    I am glad to hear that the issue is solved now. Please note that the NodeFormatting event fires when binding RadTreeView. This event will fire after the binding process finishes only when scrolling or expanding nodes.

    Do not hesitate to contact us if you have other questions.
     
    Greetings,
    Jack
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Back to Top