Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • I'm using groups to summarize my data in Outlook 2003 style as per the grid demo. It's working great, except I'd like the group corresponding to the most recent date range to expand automatically.

                                    For example, say I have two groups: "Today" and "Last Week". When the grid data loads, I'd like "Today" to start out expanded, since that's what my users are most likely to be interested in. I was looking for an event fired when a group row is added/removed, so I could expand it if it was the first group row to be created, but I could find no such event.

                                    I saw in the Outlook 2003-style section of the grid demo that you can call SetRowExpanded(-1, true), but my problem is I need to do this after the list is loaded, not on startup as in the demo, and I can't assume the grid has any group rows, since it may be empty.

                                0

                                Hello Adam,

                                You can try to use the EndGrouping event to catch the moment the data source is loaded:

                                        private void gridView1_EndGrouping(object sender, EventArgs e) {
                                            if((sender as DevExpress.XtraGrid.Views.Grid.GridView).DataRowCount > 0)
                                                (sender as DevExpress.XtraGrid.Views.Grid.GridView).SetRowExpanded(-1, true);
                                }

                                Thank you,
                                Paul

                                To start a chat you should create a support ticket


                                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