Link to home
Start Free TrialLog in
Avatar of grambowk
grambowk

asked on

setting check box for all child nodes in a tree view (VB.NET).

Hi,

I'm using a tree view control in VB.NET to display the directory structure across all my disk drives.  This I have done successfully.

Now,  I'm also using check boxes on each node.  The idea being that if I check one of the boxes then every check box lower down in the hierarchy will also be checked.  This is where I'm stuck.

How can I check every check box on each child node (and subsequent child node)?

I have tried using the BeforeCheck event but the problem is that when I programmatically check the child node, this fires off the very same BeforeCheck event.

Any ideas or suggestions as to how I can do this would be most welcome.  Please bear in mind that my competence level with VB.NET is basic.

Thanks,

Karl
Avatar of morbid666
morbid666

You could check recursively the child nodes. I presume the event "BeforeCheck" is called with the node being checked as parameter or something. So all you have to do is browse its children and check them.
ASKER CERTIFIED SOLUTION
Avatar of Jazzyfoot
Jazzyfoot

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of grambowk

ASKER

Thanks,

that worked perfectly.