treeView Checkbox


I have this tree (see attachment)
I want if I check the root all child will be checked for exemple in the attachment
I want if I check Group02, Group01 will be checked then (sphere01 and sphere02) will be checked and sphere03 will be checked. I can't find exact loops to do this.

some one can help me? thanks

untitled-1.jpg48.7 KB