THEMES

Grid - Sorting and Grouping Multi-column Sorting

Contact NameCompany NameCityRegionCountry
Page size:
select
 91 items in 10 pages
Maria AndersAlfreds FutterkisteBerlin Germany
Ana TrujilloAna Trujillo Emparedados y heladosMéxico D.F. Mexico
Antonio MorenoAntonio Moreno TaqueríaMéxico D.F. Mexico
Thomas HardyAround the HornLondon UK
Christina BerglundBerglunds snabbköpLuleå Sweden
Hanna MoosBlauer See DelikatessenMannheim Germany
Frédérique CiteauxBlondel père et filsStrasbourg France
Martín SommerBólido Comidas preparadasMadrid Spain
Laurence LebihanBon app'Marseille France
Elizabeth LincolnBottom-Dollar MarketsTsawwassenBCCanada

In some case, one column sorting may not display the data trend and changing clearly. So Kettic Grid view control allows users to make multi-column sorting at same time. Set AllowMultiColumnSorting property to True, and the other settings is just as the same as the one column sorting.

To sort data in single column, you can click a column header to change the column sort order(ascending, descending or no sort). The sort status will display on the right of this column header.

To sort data against multiple columns, pressing down the SHIFT key, and click the required column headers.



Besides the mulit-column sorting in this online demo, Kettic ASP.NET AJAX grid control provide single column sorting, too.
And there are many other operation can be done in grid, such as: grouping grid data in asp.net and reordering grid data in asp.net.

<%@ Page Title="" Language="C#" MasterPageFile="~/Demo.Master" AutoEventWireup="true" CodeBehind="MultiColumnSorting.aspx.cs" Inherits="Kettic.AspNet.Demo.KaxGridDemo.SortingGrouping.MultiColumnSorting" %>

<%@ Register TagPrefix="kettic" Namespace="Kettic.AspNet.Controls" Assembly="Kettic.AspNet.Controls,Version=2014.04.1129.0" %>
<asp:Content ID="Content1" ContentPlaceHolderID="DemoContent" runat="server">
    <kettic:KaxGrid ID="grid" runat="server" DataSourceID="AccessDataSource1" Width="100%"
        AutoGenerateColumns="False" AllowSorting="True" AllowPaging="True" GridLines="None">
        <ClientSettings>
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
        <MainView AllowMultiColumnSorting="True">
            <Columns>
                <kettic:GridBoundColumn HeaderText="Contact Name" DataField="ContactName" UniqueName="ContactName" />
                <kettic:GridBoundColumn HeaderText="Company Name" DataField="CompanyName" UniqueName="CompanyName" />
                <kettic:GridBoundColumn HeaderText="City" DataField="City" UniqueName="City" />
                <kettic:GridBoundColumn HeaderText="Region" DataField="Region" UniqueName="Region" />
                <kettic:GridBoundColumn HeaderText="Country" DataField="Country" UniqueName="Country" />
            </Columns>
        </MainView>
    </kettic:KaxGrid>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/nwind.mdb"
SelectCommand="SELECT * FROM [Customers]"></asp:AccessDataSource>

</asp:Content>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Kettic.AspNet.Demo.KaxGridDemo.SortingGrouping
{
    public partial class MultiColumnSorting : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}
Version:2014.04.1129
Copyright © 2008-2017 Kettic Inc
Your Next ASP.NET Site Best Choice

Get started today and download ASP.NET AJAX UI Controls and SDKs for 30-day free try.

Kettic provide rich online demos to view the features of each UI control. And you can find comprehensive guide to use ASP.NET controls

For more information about Kettic UI SDK, please visit the ASP.NET AJAX Controls webpage. For immediate assistance, contact us by Email at support@kettic.com.