SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to add a button to a SharePoint 2010 page to expand all grouped items in all the list views on the page? This is the first (top) level grouping only, not the second level. These are simple (standard) list views created via the web UI, where we've grouped items on one or two columns. Thanks.

share|improve this question
up vote 5 down vote accepted

Yes this is possible. You can use some javascript to do that. Here is a post about this.

The trick is to find the little minus button and then click it:

function expandGroups() { 
share|improve this answer
Thanks, SPSinan. What if I have two levels of grouping and need all to be expanded? – Alex C Dec 14 '11 at 15:06
Found the answer: Just remove the :visible from the statement and it works on the hidden grouped elements too :) – Alex C Dec 15 '11 at 4:41
Thanks for sharing the solution ;) – SPSinan Dec 15 '11 at 9:04
Tried this in SP 2010. Could not get it to work. Thanks anyway. – Clem Jan 4 '12 at 13:13
@Clem Do you get an error message or something? – SPSinan Jan 5 '12 at 9:11

one way for making sure all 3 levels are expanded

<script src="https://portal/SiteAssets/jsLibrary/jquery.1.9.1.min.js" type="text/javascript"></script>

$(document).ready(function () {
     // Wait until SP.JS has loaded before calling expandAll
    ExecuteOrDelayUntilScriptLoaded(expandAll, "sp.js");

    function expandAll(){
        //for making sure all 3 levels are expanded
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.