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

  • Home
  • SEARCH
  • 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 8683481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:03:25+00:00 2026-06-12T22:03:25+00:00

I have an ASP.net TreeView control which displays a hierarchical folder structure. Each node

  • 0

I have an ASP.net TreeView control which displays a hierarchical folder structure. Each node in the TreeView has a Long value property corresponding to a FolderId; the Text property is the Folder Name, like so:

TreeNode node = new TreeNode();
node.Text = "folder name";
node.Value = 12345;
nodes.Add(node);

I need to auto expand the TreeView to a specific node by passing in the FolderId.

The TreeView has a FindNode() method which seems to take a “value path” (string) property. This is as far as I can get:

string folderIdPath = "72|73|77";

TreeView1.PathSeparator = '|';
TreeView1.FindNode(folderIdPath).Expand();

However, this throws an “Object reference not set to an instance of an object” error.

  • 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-12T22:03:26+00:00Added an answer on June 12, 2026 at 10:03 pm

    So it turns out that you can’t actually expand a TreeView all in one go. You have to do it one node at a time, see here : http://forums.asp.net/t/1099367.aspx/1

    So now I loop through all the FolderIds and open them one at a time. The important thing to remember is that although you open them one at a time, you still need to use the full valuepath.

    See the link above for more info.

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

Sidebar

Related Questions

I have listed data for ASP.net control TreeView. I wanted to disable a particular
I do have a asp:TreeView control on my Asp.net page and when I render
I have an ASP.NET MVC application that has a jQuery Treeview and a jQuery
I have an asp.net treeview (acting as a remote file and folder browser). When
I have a ASP.Net TreeView control that I am binding to an XML data
I have a asp.net treeview control that I need to be able to set
I have a TreeView control in my ASP.NET web application, and I have problems
I am using the teleriks treeview control (asp.net mvc extensions), where I may have
I have a ASP.Net TreeView Control with Checkboxes along Child nodes. I want to
I have created one TreeView in asp.net.I want to store unique index for each

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.