Solved

Treeview with recursive checkboxes?

Posted on 2000-03-13
7
475 Views
Last Modified: 2008-02-26
HI, I am looking for a treeviewcomponent where you can enable checkboxes and they act recursive. I mean when you check the parent all the childnodes get checked as wel and visa versa. Anyone formiliar whit such a component?
0
Comment
Question by:corpa
7 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2613488
You could use this one: http://www.lischke-online.de/TreeNT.html

It doesn't do the resursive action, but it is easy enough to do.

Cheers,

Raymond.
0
 
LVL 10

Accepted Solution

by:
Lischke earned 100 total points
ID: 2615238
Well, Ray is right in that my TreeNT supports checkboxes, but is wrong about the recursive behaviour. Setting the check kind to tri-state causes dependent nodes (children or parents or both, whatever applies) to track check state changes of a node.

Ciao, Mike
0
 
LVL 1

Expert Comment

by:AttarSoftware
ID: 2615503
ooOOooOOooOOooOOoo ;O)

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:corpa
ID: 2617556
Hello Mike,

I've added the following in the onchecked event and it works just fine.

procedure TForm1.TreeNT1Checked(Sender: TObject; Node: TTreeNTNode);
var t : integer;
begin
  if node.HasChildren then
   begin
    for t := 0 to Node.Count-1 do
     begin
       Node.Item[t].CheckState := csChecked;
     end;
   end;
end;

So my problem is solved.
Since it is your component i'd like to give you the credits.
Thanks alot,
Pascal
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2618012
Mike - I'm sure TTreeNT won't do this recursive behaviour itself, will it? (ie: You need to right the handler above as I suggested...)

Cheers,

Raymond.
0
 
LVL 10

Expert Comment

by:Lischke
ID: 2618918
Well, the check concept is admittedly difficult to understand but it is as I said. When a node's check kind is tri-state (ctCheckboxGrayed), then changes to it are propagated down to all its children and up to its parent. Both ways are recursive. See also CheckParentCheckState for up-propagation and line 2122 ff. (method TTreeNTNode.SetCheckState) in TreeNT.pas (version 3.1 from Nov last year) for down propagation.

Ciao, Mike
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2621162
Hi Mike,

Yes, I had a poke around in the source before I posted the comment. I saw what you mean about the tri-state behaviour...

Anyway, enough of this! TTreeNT rules OK! ;-)

Cheers,

Raymond.

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Read/Write registry value from HKEY_LOCAL_MACHINE 5 172
System restore point 4 77
Thread safe  opinion 7 111
delphi exception 7 58
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now