Telerik is a leading vendor of ASP.NET AJAX, ASP.NET MVC, Silverlight, WinForms and WPF controls and components, as well as .NET Reporting, .NET ORM , .NET CMS, Code Analysis, Mocking, Team Productivity and Automated Testing Tools. Building on its expertise in interface development and Microsoft technologies, Telerik helps customers build applications with unparalleled richness, responsiveness and interactivity. Telerik products help thousands of companies to be more productive and deliver reliable applications under budget and on time.
Version Q1 2012 released 04/11/2012
select

Grid / Displaying Pivot Data

ALFKIANATRANTONAROUTBERGS
CompanyNameAlfreds FutterkisteAna Trujillo Emparedados y heladosAntonio Moreno TaqueríaAround the HornBerglunds snabbköp
ContactNameMaria AndersAna TrujilloAntonio MorenoThomas HardyChristina Berglund
ContactTitleSales RepresentativeOwnerOwnerSales RepresentativeOrder Administrator
AddressObere Str. 57Avda. de la Constitución 2222Mataderos 2312120 Hanover Sq.Berguvsvägen 8
PostalCode122090502105023WA1 1DPS-958 22
CityBerlinMéxico D.F.México D.F.LondonLuleå
CountryGermanyMexicoMexicoUKSweden

  • This example demonstrates how Telerik RadGrid can be bound to pivot table. This is especially useful when you want to display the data in a reverse order but still keep the same presentation and structure in the source table. The logic resides in the PivotTable method in the code-behind of the page which transforms the table rows into columns and the table columns into rows in the rendered grid.
    Note, however, that features like paging, sorting, grouping, filtering, etc. will behave in a different way because the type of the data in the grid columns can vary (for example integers, strings, dates, etc.). This is due to the "vertical grid" effect. That is why sometimes they may return unexpected results and you should consider whether to enable them or execute your custom logic to manipulate the data in the grid.

Source Code

C# VB.NET
Show code in new window Demo isolation steps
  • <%@ Page Language="vb" AutoEventWireup="false" Inherits="Telerik.GridExamplesVBNET.Programming.Pivot.DefaultVB"
        CodeFile="DefaultVB.aspx.vb" %>

    <%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="telerik" TagName="Header" Src="~/Common/Header.ascx" %>
    <%@ Register TagPrefix="telerik" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
    <%@ Register TagPrefix="telerik" TagName="Footer" Src="~/Common/Footer.ascx" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <telerik:HeadTag runat="server" ID="Headtag2"></telerik:HeadTag>
    </head>
    <body class="BODY">
        <form runat="server" id="mainForm" method="post">
            <telerik:Header runat="server" ID="Header1" NavigationLanguage="VB"></telerik:Header>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
            <!-- content start -->
                <telerik:RadGrid ID="RadGrid1" Width="97%" runat="server">
                </telerik:RadGrid>
            <!-- content end -->
            <telerik:Footer runat="server" ID="Footer1"></telerik:Footer>
        </form>
    </body>
    </html>

Get more than expected!

Take your time to truly experience the power of RadControls for ASP.NET AJAX with a free 60-day trial backed up by Telerik’s unlimited dedicated support.

Download your RadControls for ASP.NET AJAX trial and jumpstart your development with the available Getting Started resources.

If you have any questions, do not hesitate to contact us at sales@telerik.com.

Copyright 2002-2012 © Telerik. All right reserved
Telerik Inc, 201 Jones Rd, Waltham, MA 02451