Welcome to the Xceed Community | Help
Community Search  
More Search Options

How do I force a Detail grid's group to be collapsed by default?

Sort Posts: Previous Next
  •  04-12-2010, 5:19 PM Post no. 26465

    How do I force a Detail grid's group to be collapsed by default?

    I have a Master/Detail scenario wherein the Details are grouped. For an example, say we are dealing with Books (Master) and Pages (Detail), where pages are grouped by Subject:

     

    - Book 1 | Author: Someone | Bleah

      - Subject: Economics | #Pages: 123

           Page 234 | Detail    | Other | Etc

           Page 237 | Detail2  | Other | Etc

    - Subject: Mathematics | #Pages: 34

           Page 111 | Detail    | Other | Etc

           Page 109 | Detail2  | Other | Etc

     

    Following some other posts and examples, I am using a StatRow in the GroupHeaderControl to give an in-grid summary of the subject's detail group.  I have written my own StatFunction to summarize fields across the group, etc. That all is working perfectly.

     What I am trying to do now is to get the detail group to be collapsed by default, and I am not seeing any clear paths. Is there something I am missing?

     I want to have the subject groups collapsed by default when the book row details are expanded (as opposed to the above example):  

     

    - Book 1 | Author: Someone | Bleah

      + Subject: Economics | #Pages: 123

      + Subject: Mathematics | #Pages: 34

     

    Anyone have any suggestions? 

    Filed under: , , ,
  •  04-16-2010, 12:01 PM Post no. 26517 in reply to 26465

    Re: How do I force a Detail grid's group to be collapsed by default?

    Can anyone assist me with this? The only expansion information I have found do not appear to be for the WPF grid, and certainly don't deal with dynamically generated detail scenarios. Surely there is a way to get this to work...
  •  04-16-2010, 2:07 PM Post no. 26520 in reply to 26517

    Re: How do I force a Detail grid's group to be collapsed by default?

    Hi Elliott,

    When creating your GroupConfiguration, you can set the InitiallyExpanded property to False.

     


    ** Quick Tip: Clients with an active support subscription should be sending their questions by email if they wish to benefit from the faster response time. Thanks!


    Diane Lafontaine
    Technical Support
    Xceed Software Inc.
  •  04-16-2010, 4:22 PM Post no. 26522 in reply to 26520

    Re: How do I force a Detail grid's group to be collapsed by default?

    I do have this set on the DefaultGroupConfiguration, but it does not seem to have any effect on the groupings inside my Detail grids. How do i set GroupConfigurations on my details?

    I am using custom DataGridDetailDescription-derived types in my DataGridCollectionViewSource, and the DataGridGroupDescription does not have an InitiallyExpanded property.

  •  04-16-2010, 4:31 PM Post no. 26523 in reply to 26522

    Re: How do I force a Detail grid's group to be collapsed by default?

    Oh, and sorry for the delayed reply, evidently my reply notification email hadn't been turned on.
  •  04-16-2010, 4:51 PM Post no. 26524 in reply to 26523

    Re: How do I force a Detail grid's group to be collapsed by default?

    Hi Elliott,

    You have to set the DefaultGroupConfiguration on the main and detail level separately.

    For example:

       <xcdg:DataGridControl.DefaultGroupConfiguration>
          <xcdg:GroupConfiguration InitiallyExpanded="False" />
       </xcdg:DataGridControl.DefaultGroupConfiguration>

       <xcdg:DataGridControl.DefaultDetailConfiguration>
          <xcdg:DefaultDetailConfiguration>
             <xcdg:DefaultDetailConfiguration.DefaultGroupConfiguration>
                <xcdg:GroupConfiguration InitiallyExpanded="False" />
             </xcdg:DefaultDetailConfiguration.DefaultGroupConfiguration>
          </xcdg:DefaultDetailConfiguration>
       </xcdg:DataGridControl.DefaultDetailConfiguration>

     


    ** Quick Tip: Clients with an active support subscription should be sending their questions by email if they wish to benefit from the faster response time. Thanks!


    Diane Lafontaine
    Technical Support
    Xceed Software Inc.
  •  04-16-2010, 8:27 PM Post no. 26525 in reply to 26524

    Re: How do I force a Detail grid's group to be collapsed by default?

    This was an approach I was unaware of (DefaultDetailConfiguration). However, after setting this default at all three levels of the Master/Detail hierarchy, it seems to have no effect. All groups are still expanded by default. Any thoughts?
  •  04-22-2010, 4:08 PM Post no. 26587 in reply to 26525

    Re: How do I force a Detail grid's group to be collapsed by default?

    Hi Elliott,

    I am unable to reproduce the problem you describe. I would need a test project that demonstrates the issue in order to investigate further. You can send it to support@xceed.com (please include a link to this forum thread for reference). Thank you.

     


    ** Quick Tip: Clients with an active support subscription should be sending their questions by email if they wish to benefit from the faster response time. Thanks!


    Diane Lafontaine
    Technical Support
    Xceed Software Inc.
  •  04-24-2010, 2:14 AM Post no. 26605 in reply to 26587

    Re: How do I force a Detail grid's group to be collapsed by default?

    I dug a bit deeper, and it turns out I was setting the default group on the default detail (which seems to only apply to dynamic groups, etc.) Instead I did the following and thus set the default group configuration per detail and detail-detail level:

     <xcdg:DataGridControl>

    <xcdg:DataGridControl.DetailConfigurations>

    <xcdg:DetailConfiguration x:Name="d1">

    <xcdg:DetailConfiguration.DefaultGroupConfiguration>

    <xcdg:GroupConfiguration InitiallyExpanded="False" />

    </xcdg:DetailConfiguration.DefaultGroupConfiguration>

    </xcdg:DetailConfiguration>

    <xcdg:DetailConfiguration x:Name="d2">

    <xcdg:DetailConfiguration.DetailConfigurations>

    <xcdg:DetailConfiguration x:Name="d2.1">

    <xcdg:DetailConfiguration.DefaultGroupConfiguration>

    <xcdg:GroupConfiguration InitiallyExpanded="False" />

    </xcdg:DetailConfiguration.DefaultGroupConfiguration>

    </xcdg:DetailConfiguration>

    </xcdg:DetailConfiguration.DetailConfigurations>

    </xcdg:DetailConfiguration>

    </xcdg:DataGridControl.DetailConfigurations>

    </xcdg:DataGridControl>

     

     

     Everything is working as expected. Thanks! 

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.