Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8329977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:58:21+00:00 2026-06-09T01:58:21+00:00

In my treeview I want to remember which nodes were expanded and redraw that

  • 0

In my treeview I want to remember which nodes were expanded and redraw that state after I delete or insert a node. I solved that with remembering the index of an expanded node. If a node is removed, I decrement all indeces that were afterwards.
That works because I can access the deleted node with treeView.SelectedNode, but how can I get the new Index of the inserted node?
I can not solve it with saving a reference to the node or a name or a tag, because when I redraw the tree the nodes are created completely new – and I think I can not get a reference to the newly created node anyway
Best regards, Expecto

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:58:23+00:00Added an answer on June 9, 2026 at 1:58 am

    The answers were not really what I was looking for, but after I found out that after an insert the “AfterSelect” Event fires, I did it this way:

    private void treeViewProduct_AfterSelect(object sender, TreeViewEventArgs e)
        {
    
            if (insertMode)
            {
    
                treeViewProduct.NotifyAboutInsert(e.Node.Index);
            }
    ...
    }
    

    My treeview then handles the changed indices for the nodes after that and perfectly redraws the tree.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a treeView with many nodes. I want that some nodes change their
I'm writing a bit of code that I want to populate a TreeView, which
In my treeview, after adding a fold, I want that row to be highlghted
I want all the childs of given node in YUI treeview. Condition is that
I have a node on a TreeView that I populate manually and want to
I want to make in a TreeView (winforms) that each node will have in
I want to dynamically construct a TreeView using Node which represents a typical tree
I want to browse through XML using a TTreeView. To associate the treeview nodes
I have a treeView , and i want to know if some node can
I want that i should be able to drag items from jquery treeview that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.