Solved

Treeview with recursive checkboxes?

Posted on 2000-03-13
7
485 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
[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
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
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.…

717 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