Requirements:
. selectable groups and items
. click on the arrow expand and collapse groups
. click on row selects the item or group
. click on group row select all items within
download bmml source – Wireframes created with Balsamiq Mockups
My question is: When you select some items within the group and you collapse the Group, how should you indicate that group has selected items? If you indicate the group has some selected items the same way you indicate the whole group is selected it could cause confusion?