?
Solved

Treeview and text files

Posted on 2003-02-23
6
Medium Priority
?
167 Views
Last Modified: 2010-04-04
Can i populate a treeview, with each node being the contents of a text file???  This would have to be about 5/6 lines for each node.

or is there a method to populate treeview, and show the data for each node in the text box next to it.

for example, clicking on node A loads a text file into the text box relating to contents A?
0
Comment
Question by:rangi999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 200 total points
ID: 8006592
Procedure LoadToNode(ANode : TTreeNode);
var Node : TTreeNode;
    sl : TSringList;
    i  : integer;
begin
  if assigned(ANode) then
  begin
    sl := TSringList.Create;
    try
      sl.LoadFromFile(ANode.Text+'.txt');
      for i := 0 ro sl.count-1 do
        ANode.TreeView.Items.Addchild(sl[i]);
    finally
      sl.Free;
    end;
  end;
end;

just from head

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 8006593
ro -> to :-))
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 8006599
terrible typo
this

     for i := 0 ro sl.count-1 do
       ANode.TreeView.Items.Addchild(sl[i]);
     
should be

     for i := 0 ro sl.count-1 do
     begin
       Node.TreeView.Items.Addchild(ANode);
       Node.Text := sl[i];
     end;

meikl ;-)
0
 

Expert Comment

by:CleanupPing
ID: 9317117
rangi999:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 10

Expert Comment

by:kacor
ID: 9956093
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       to accept kretzschmar's answer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Some days and here is the Christmas Time. I wish good luck and good health for you all and for your loved ones

kacor
EE Cleanup Volunteer
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question