Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hello,
                                    I'm using WPF DXGrid v9.3 in my project.
                                    I need to automatically expand all groups in grid when grouping changes. Setting AutoExpandAllGroups to True didn't work for me, because grid started to expand groups on every sorting(!) operation. The EndGrouping event is firing after each sorting operation too. When I set AutoExpandAllGroups to False and used ExpandAllGroups in some cases, then groups started collapsing when sorted on columns with GroupInterval="DateRange".

                                0

                                Hi Alexey,

                                We have researched this issue and come to the conclusion that this behavior is by design. The GridControl doesn't preserve the expanding state when the column sorting is changed. Moreover, when the AutoExpandAllGroups is set to true, the rows expansion is performed each time the data changes. This is done because the grid itself doesn't have an internal cache, and doesn't save the rows state internally. This approach is used to improve the grid's performance. However, with this technique, it is necessary to re-group data each time the user changes it. This operation causes the row expansion. Basically, the AutoExpandAllGroups property is designed to be used to always show all groups expanded. It doesn't cover more complex logic when an end-user manually changes the row expansion state. However, you can achieve the required functionality by handling the grouped columns collection's CollectionChanged event. Here is a sample code demonstrating this approach:

                                [C#]
                                ObservableCollectionCore<GridColumn> collection = gridControl1.View.GroupedColumns as ObservableCollectionCore<GridColumn>; collection.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(collection_CollectionChanged); ... void collection_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { gridControl1.ExpandAllGroups(); }

                                Please let me know if this solution meets your requirements.
                                Thanks,
                                Stan.

                                0

                                I'm already used this workaround. But it did not solve the problem. As I said earlier, when I set AutoExpandAllGroups to False and used ExpandAllGroups in some cases(e.g. ObservableCollectionCore.CollectionChanged), then the groups started collapsing when sorted on grouped columns with GroupInterval="DateRange"(e.g. colPerfomanceDate)

                                0

                                Hi Alexey,

                                Thank you for the additional explanation. I have managed to reproduce the problem on my side. It appears to be a different bug unrelated to the auto-expanding behavior. I have created a separate issue about it (XtraGrid, DXGrid - If a grouped column's GroupInterval property is different from the "Value", groups are automatically collapsed when sorting data) and we'll do our best to find a solution ASAP.

                                Thanks,
                                Stan.

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners