Use the PanelBar.ExpandMode property to determine the operation of the PanelBar expand/collapse behavior.
In order to make an "accordian" style PanelBar where all of the Groups can be independantly expanded or collapsed and the height of the entire PanelBar is determined by the content of all the expanded panels, set:
The PanelBar will now expand or collapse the group when the user clicks the group button. Any of the groups can be expanded or collapsed at any giving time. The overall height of the PanelBar will adjust to accomodate the height of all the expanded Groups and their content.