Current filter:
                                You should refresh the page.
                                Support Center

                                ASPxGridView - How to sort groups via the GroupSummarySortInfo class

                                0

                                This example demonstrates how to group ASPxGridView by cities, but sort it by countries via the GroupSummarySortInfo class.

                                This is a sample project for the ASPxGridView - How to sort groups Knowledge Base article. Please refer to it for an explanation.

                                see also:

                                ASPxGridView - How to sort groups via the CustomColumnSort event
                                ASPxGridView - How to sort groups via the GroupSummarySortInfo class and CustomSummaryCalculate event
                                ASPxGridView - How to sort grouped GridViewDataComboBoxColumn by text

                                You must  log in  or  register  to leave comments
                                Select file
                                • Default.aspx
                                • Default.aspx.cs
                                Select language
                                • C#
                                • VB.NET
                                Select version
                                • v2013 vol 1.4 - v2013 vol 2.9
                                • v2010 vol 1.9 - v2012 vol 2.16
                                <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
                                
                                <%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.1, Version=10.1.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
                                    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
                                <%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.1, Version=10.1.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
                                    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
                                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                                <html xmlns="http://www.w3.org/1999/xhtml">
                                <head runat="server">
                                    <title>Untitled Page</title>
                                </head>
                                <body>
                                    <form id="form1" runat="server">
                                        <div>
                                            <dx:ASPxGridView ID="gridCustomers" runat="server" AutoGenerateColumns="False" Width="500px"
                                                DataSourceID="dsCustomers" KeyFieldName="CustomerID">
                                                <Columns>
                                                    <dx:GridViewDataTextColumn FieldName="CustomerID" ReadOnly="True" VisibleIndex="0">
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn FieldName="ContactName" VisibleIndex="1">
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn FieldName="City" VisibleIndex="2" GroupIndex="0">
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn FieldName="Region" VisibleIndex="3">
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn FieldName="Country" VisibleIndex="4" SortIndex="0" SortOrder="Ascending">
                                                    </dx:GridViewDataTextColumn>
                                                    <dx:GridViewDataTextColumn FieldName="CompanyName" VisibleIndex="5">
                                                    </dx:GridViewDataTextColumn>
                                                </Columns>
                                                <GroupSummary>
                                                    <dx:ASPxSummaryItem FieldName="Country" SummaryType="Min" />
                                                </GroupSummary>
                                                <Templates>
                                                    <GroupRowContent>
                                                        <%# Container.GroupText + " (" + Container.SummaryText.Split('=')[1]%>
                                                    </GroupRowContent>
                                                </Templates>
                                                <Settings ShowGroupPanel="True" />
                                            </dx:ASPxGridView>
                                            <asp:AccessDataSource ID="dsCustomers" runat="server" DataFile="~/App_Data/nwind.mdb"
                                                SelectCommand="SELECT [CustomerID], [ContactName], [City], [Region], [Country], [CompanyName] FROM [Customers]">
                                            </asp:AccessDataSource>
                                        </div>
                                    </form>
                                </body>
                                </html>

                                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