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 611377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:46:38+00:00 2026-05-13T17:46:38+00:00

[This is an updated version of a question posted earlier, the previous title was

  • 0

[This is an updated version of a question posted earlier, the previous title was Selecting node by index in Delphi’s Virtual Treeview.]

After the better part of a day, I believe I’ve got the Virtual Treeview component (powerful but complex) working in a simple two table data aware fashion.

Now, I’m trying to simply select the 1,512th (for instance) of the top-level nodes. I can’t see any way to do this other than getting the first top-level node and then calling GetNextSibling 1,511 in a loop.

This seems needlessly involved. Is there a simpler way?

UPDATE

Because initializing the nodes in my tree requires database access, initializing all the nodes at startup is not feasible. When the user starts with form with no record already selected, that’s fine. As the user scrolls around the tree, enough nodes are populated to display the current window into the tree and the performance is fine.

When the user starts the form in dialog mode with a database record already selected, I must advance the tree to that node before the user sees the form. This is a problem because, if the record is towards the end of the tree, it can take ten seconds as I walk the tree from the first node. Each time I can GetNextSibling(), a node is initialized, even though the vast majority of those nodes are not displayed to the user. I would prefer to defer the initialization of those nodes to the point at which they become visible to the user.

I know that there must be a better way, because if I open the tree without a record selected and use the vertical scroll bar to move, in a single operation, to the middle of the tree then the correct nodes are displayed without having to initialize the nodes I skipped over.

This is the effect I’d like to achieve when opening the tree with a record selected. I know the index of the node I want to go to, but if I can’t get there by index I could do a binary search on the tree assuming I can jump some number of nodes backwards and forwards (similar to scrolling directly to the middle of the tree).

Alternatively, perhaps there is some State setting I can make to the tree view that will leave the intermediate nodes uninitialized as I traverse the grid. I’ve tried Begin/End Update and that doesn’t seem to do the trick.

  • 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-05-13T17:46:38+00:00Added an answer on May 13, 2026 at 5:46 pm

    To get a node’s sibling without initializing it, just use the NextSibling pointer (see declaration of TVirtualNode).

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

Sidebar

Related Questions

This question is an updated version of a previous question I have asked on
This is an updated part 2 of a question I asked earlier. I'm trying
In a previous question i made Dynamic dependent select menus i posted this example
Earlier this week I posted a question about how to effectively share files amongst
This is a slightly updated question that was originally posted here: XSL - Finding
I have updated my symfony version to 2.0.12 version. But I have this error
Update: I updated this after doing some digging and realizing that this might be
Updated Question: $(this).attr(EmployeeId, 'A42345'); $.ajax({ type: POST, url: url, data: {EmployeeId: ' + id
This is pretty straight forward. EDIT: Updated question and added fourth echo. Here is
N.B THIS QUESTION HAS BEEN UPDATED, READ FURTHER DOWN Hi, I want to create

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.