Programmatically call NodeFormatting

5 posts, 0 answers
  1. Itai
    Itai avatar
    2 posts
    Member since:
    Oct 2015

    Posted 08 Oct 2015 Link to this post

    Hello, i have a treeview who changes his content dynamically via the NodeFormatting event. 

    Is there a way to programmatically call this event so I can refresh the content without the need to hover with the mouse above it?

     I've tried the Refresh() method but nothing happens. 

     

    Thanks in advance! 

     

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3624 posts

    Posted 08 Oct 2015 Link to this post

    Hello Itai,

    Thank you for writing.

    In order to force the NodeFormatting event, you can call the RadTreeView.BeginUpdate and RadTreeView.EndUpdate methods. An alternative solution is to call the TreeViewElement.Update method:
    this.radTreeView1.TreeViewElement.Update(Telerik.WinControls.UI.RadTreeViewElement.UpdateActions.Reset);

    I hope this information helps. Should you have further questions I would be glad to help.
     
    Regards,
    Dess
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Mark
    Mark avatar
    121 posts
    Member since:
    Oct 2014

    Posted 12 Jun 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Dess said:Hello Itai,

    Thank you for writing.

    In order to force the NodeFormatting event, you can call the RadTreeView.BeginUpdate and RadTreeView.EndUpdate methods. An alternative solution is to call the TreeViewElement.Update method:
    this.radTreeView1.TreeViewElement.Update(Telerik.WinControls.UI.RadTreeViewElement.UpdateActions.Reset);

    I hope this information helps. Should you have further questions I would be glad to help.
     
    Regards,
    Dess
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

    This works, but what I don't like, is that the tree view flashes. Is there a way to prevent that?

     

    Thanks

  4. Mark
    Mark avatar
    121 posts
    Member since:
    Oct 2014

    Posted 12 Jun 2018 in reply to Mark Link to this post

    Mark said:
    Dess said:Hello Itai,

    Thank you for writing.

    In order to force the NodeFormatting event, you can call the RadTreeView.BeginUpdate and RadTreeView.EndUpdate methods. An alternative solution is to call the TreeViewElement.Update method:
    this.radTreeView1.TreeViewElement.Update(Telerik.WinControls.UI.RadTreeViewElement.UpdateActions.Reset);

    I hope this information helps. Should you have further questions I would be glad to help.
     
    Regards,
    Dess
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

    This works, but what I don't like, is that the tree view flashes. Is there a way to prevent that?

     

    Thanks

     

    Ok, so, after some playing around, if you just call

    <p></p><p>radTreeView1.Nodes.Refresh()</p>

    This does the same thing, which out causing the tree view to blink.

     

     


  5. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3624 posts

    Posted 13 Jun 2018 Link to this post

    Hello, Mark,  

    I am glad that you have found a suitable solution for your case. However, note that it is normal that the RadTreeView may flash when you reset it completely. Refreshing only the nodes causes a lighter visual update. Feel free to use it for your scenario.

    If you have any additional questions, please let me know. 

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top