# Problem with expand/collapse all (Groups)

**URL:** https://resource.dopus.com/t/problem-with-expand-collapse-all-groups/13152
**Category:** Help & Support
**Created:** [May 13, 2012, 7:09pm UTC](https://resource.dopus.com/t/problem-with-expand-collapse-all-groups/13152 "2012-05-13T19:09:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![jpu](https://resource.dopus.com/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@jpu](https://resource.dopus.com/u/jpu)
#### Post date: [May 13, 2012, 7:09pm UTC](https://resource.dopus.com/t/problem-with-expand-collapse-all-groups/13152/1 "2012-05-13T19:09:12Z")

</div>

Hello  
I have two buttons on a toolbar, with codes 'Go GROUPCOLLAPSE \*' and 'Go GROUPEXPAND \*' respectively.  
At the moment, they do not recognise whether the current display is grouped or not...

Say i group the file display according to any criterion, both buttons remain grayed out UNLESS I first refresh the file display (Go Refresh), after which they become clickable.

Likewise If i then set the grouping to 'none', the two buttons remain clickable (which they shouldn't, since there is nothing to expand/collapse), unless i again refresh.

---

<div class="post-metadata">

### Author: ![Cris](https://resource.dopus.com/user_avatar/resource.dopus.com/cris/32/25993_2.png) [@Cris](https://resource.dopus.com/u/Cris)
#### Post date: [May 16, 2012, 11:44am UTC](https://resource.dopus.com/t/problem-with-expand-collapse-all-groups/13152/2 "2012-05-16T11:44:05Z")

</div>

> [@jpu](#):
>
> I have two buttons on a toolbar, with codes 'Go GROUPCOLLAPSE \*' and 'Go GROUPEXPAND \*' respectively.

Try this code (the buttons remain clickable, but you don't have to refresh):

dopusrt /cmd Go GROUPCOLLAPSE \*

and:

dopusrt /cmd Go GROUPEXPAND \*

---

<div class="post-metadata">

### Author: ![jpu](https://resource.dopus.com/letter_avatar_proxy/v4/letter/j/ce7236/32.png) [@jpu](https://resource.dopus.com/u/jpu)
#### Post date: [May 20, 2012, 12:29am UTC](https://resource.dopus.com/t/problem-with-expand-collapse-all-groups/13152/3 "2012-05-20T00:29:19Z")

</div>

Thanks for the response.  
That indeed helps, though I would prefer it if the buttons are clickable only when display is grouped (and greyed out when not).

Furthermore, ideally, the 'collapse all' would be highlighted (and/or unclickable) if all groups are already collapsed (and similarly 'expand all' highlighted when all expanded).

P.S I think it is useful when the buttons affecting display are dynamically 'aware' of the current display - either via the 'click-state' OR 'highlighting'. As is currently the case for most other buttons
