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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:02:48+00:00 2026-05-19T11:02:48+00:00

I guess everyone who had ever used Delphi’s VirtualStringTree will agree that it is

  • 0

I guess everyone who had ever used Delphi’s VirtualStringTree will agree that it is a great control. It is a “virtual” control (your data must be held somewhere else) so I was thinking what data structure is the best suited for such a task? IMO that data structure must support hierarchy, it must be fast and easily expandable. The easiest implementation would be using a record and that’s what most of the documentation which can be found is suggesting. But what if you need to do some fast lookups, calculate totals, etc? What data structure you are using together with VirtualStringTree?

EDIT1: I’m using Delphi 2010.

OK, I’ll try to give some more details about my requirements.
Data size can be very variable, from 1 to thousands of items. Each item can hold multiple string, integer values. I need random access, my data can change many times during the application lifetime. Good performance is very desirable. I also need data saving and reloading.

EDIT2:
Got 1 answer so I’ll try to comment my opinion. Thanks, Dorin for your answer but
I don’t think your structure is very convenient.
1) It doesn’t deal with hierarchy.
2) Having separate TStringList’s or TList’s for each node is not very effective IMO. With this implementation I can only lookup the current node’s data, but can’t effectively search in the whole tree.

I think this data structure must be like a tree. It must have nodes with ability to add children. Then I just could get node’s data in OnInitNode event, check if my node has some children, set ivsHasChildren flag if so, then in OnInitChildren event set correct children count. Later in OnGetText event I could just fetch needed data from my node structure and set it to CellText based on the Column index. My idea is to have a separate data structure and do all the needed operations with it without a need to use VirtualStringTree. Hope someone got my point :).

EDIT3: I’ve found quite interesting JclTrees unit which at first sight could be used to achieve what I’m looking for. It belongs to JCL library. Lack of decent documentation makes it hard to quickly investigate it’s functionality. I’ll probably look deeper into it when I have some more time.

  • 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-19T11:02:48+00:00Added an answer on May 19, 2026 at 11:02 am

    OK, because given answers didn’t solved my issues I’ve written my own tree data structure which imitates TVirtualStringTree and handles all the problems I mentioned in my question. Now I can optionally use only my data structure and all the changes in it will automatically update the VirtualStringTree. I think I will upload source code somewhere later and post the link here. Thanks for all the answers.

    EDIT: I’ve uploaded source to the Google code: svTrees. There is a little demo that shows how it works.

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

Sidebar

Related Questions

I guess I'm really after an aid to help people who forget, Cruise Control
I guess these are all questions that everyone must just know, because I'm not
I have a logical statement that says If everyone plays the game, we will
My guess is that class variables (class var) are truly global in storage (that
I guess the real question is: If I don't care about dirty reads, will
I guess I have been using the Web Site model ever since .NET 2.0
I have an interface and I want everyone who implements this interface to implements
I guess everyone has run into missing dll's issues from time to time. What
I guess everyone has already heard the news about some key developers leaving the
I guess everything is in the title... I know that Dictionary<TKey,TValue> does keep the

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.