Bug Report Q304672
Visible to All Users

ASPxGridView - After a grid filter, my groups don't stay expanded if the AutoExpandAllGroups property is true

created 14 years ago

I am grouping by a column (void field) and when the grid initially loads the two groups are expanded (if there is data for each group) which is correct. But if there are are no records in one of the groups, when i do another filter (by date in my example) the grouping type that had no records in its group before now will not be expanded even if it has records.
On my 1st screenshot, for that date, there were no voids, so the 'Voided: Yes' grouping is hidden. So when I filter by another date, 2nd screenshot, there are records in the 'Voided: Yes' grouping but the group is collapsed.
I have the AutoExpandAllGroups set to true in the grid and also have ASPxGridView1.SettingsBehavior.AutoExpandAllGroups = "true" set on the grid load.
Is there more I need to do to keep these groupings always expanded?
aspx:
<dxwgv:ASPxGridView Width="100%" ID="ASPxGridView1" runat="server"
        AutoGenerateColumns="False" DataSourceID="ObjectDataSource1"
        KeyFieldName="Receipt_No" >

  <SettingsBehavior AutoExpandAllGroups="true" />
aspx.vb:
Protected Sub ReceiptGrid_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

  If IsPostBack Then
            ASPxGridView1.SettingsBehavior.AutoExpandAllGroups = "true"
        End If
Hope I am making sense.
Thank you.
Steps to Reproduce:

  1. run the project
  2. filter the grid by setting the ProductId to 78
  3. clear the filter
Show previous comments (3)
DevExpress Support Team 14 years ago

    Hi Matt,
    We've researched the problem and come to the conclusion that this behavior is by design. This property (AutoExpandAllGroups) is only applied if

    1. the page is loaded for the first time and there is no post data;
    2. grouping is changed.
      If you want to have all groups to be always expanded, call the ASPxGridView.ExpandAll methods within the AfterPerformCallback event handler.
      Thanks,
      Plato

      that worked great, I appreciate it. the code i used was
      VB:
          Protected Sub ASPxGridView1_AfterPerformCallback(ByVal sender As Object, ByVal e As DevExpress.Web.ASPxGridView.ASPxGridViewAfterPerformCallbackEventArgs) Handles ASPxGridView1.AfterPerformCallback
              ASPxGridView1.ExpandAll()
          End Sub

      DevExpress Support Team 14 years ago

        You are always welcome, Matt
        Thanks,
        Plato

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.