PivotGrid - On PageLoad

ProfitExpensesCountryCityDestinationCountry
TransportTypeCompany
BulgariaBulgaria Sum of ProfitBulgaria Sum of Expenses FranceFrance Sum of ProfitFrance Sum of Expenses GreeceGreece Sum of ProfitGreece Sum of Expenses HungaryHungary Sum of ProfitHungary Sum of Expenses ItalyItaly Sum of ProfitItaly Sum of Expenses RomaniaRomania Sum of ProfitRomania Sum of Expenses SpainSpain Sum of ProfitSpain Sum of Expenses UKUK Sum of ProfitUK Sum of ExpensesTotal Sum of ProfitTotal Sum of Expenses
SofiaSofia Sum of ProfitSofia Sum of Expenses ParisParis Sum of ProfitParis Sum of Expenses AthensAthens Sum of ProfitAthens Sum of Expenses KavalaKavala Sum of ProfitKavala Sum of Expenses SzegedSzeged Sum of ProfitSzeged Sum of Expenses BresciaBrescia Sum of ProfitBrescia Sum of Expenses ArgesArges Sum of ProfitArges Sum of Expenses BucharestBucharest Sum of ProfitBucharest Sum of Expenses MadridMadrid Sum of ProfitMadrid Sum of Expenses BrandonBrandon Sum of ProfitBrandon Sum of Expenses
UKGreeceSpainBulgariaGreeceRomaniaCroatiaItalySlovakiaFrancePolandUK
Sum of ProfitSum of ExpensesSum of ProfitSum of ExpensesSum of ProfitSum of ExpensesSum of ProfitSum of ExpensesSum of ProfitSum of ExpensesSum of ProfitSum of ExpensesSum of ProfitSum of ExpensesSum of ProfitSum of ExpensesSum of ProfitSum of ExpensesSum of ProfitSum of ExpensesSum of ProfitSum of ExpensesSum of ProfitSum of Expenses
MicrovanAdvanced Services Ace
Continential World Corp
Digital Corporate
Executive Imagination
Interactive Key Software
Internet Innovation Telecom
Networks Future Ll
Profit Interworks
Server Compu
Superior Outsourcing LLC
Grand Total
59450.0093446.4059450.0093446.4059450.0093446.4065395.00104509.6862422.5041716.08127817.50146225.76127817.50146225.7653505.0027922.3280257.5032693.22133762.5060615.5453505.0019451.8853505.0019451.88187267.5080067.4244587.5014173.2044587.5014173.2044587.5014173.2029725.0010527.6029725.0010527.6029725.0010527.6059450.0033814.8059450.0033814.8065395.0091087.9265395.0091087.92124845.00124902.7262422.50100462.3262422.50100462.3262422.50100462.3253505.005658.1253505.005658.1253505.005658.12689620.00575463.54
65395.00102791.0465395.00102791.0465395.00102791.0495120.00152014.0859450.0039729.60154570.00191743.68154570.00191743.6847560.0024819.8453505.0021795.48101065.0046615.3262422.5022693.8662422.5022693.86163487.5069309.1865395.0020787.3665395.0020787.3665395.0020787.3632697.5011580.3632697.5011580.3632697.5011580.3644587.5025361.1044587.5025361.1047560.0066245.7647560.0066245.7692147.5091606.8665395.00105246.2465395.00105246.2465395.00105246.2432697.503457.7432697.503457.7432697.503457.74671785.00596522.46
59450.0093446.4059450.0093446.4059450.0093446.4089175.00142513.2044587.5029797.20133762.50172310.40133762.50172310.4056477.5029473.5665395.0026638.92121872.5056112.4850532.5018371.2250532.5018371.22172405.0074483.7062422.5019842.4862422.5019842.4862422.5019842.4826752.509474.8426752.509474.8426752.509474.8474312.5042268.5074312.5042268.5044587.5062105.4044587.5062105.40118900.00104373.9071340.00114814.0871340.00114814.0871340.00114814.0865395.006915.4865395.006915.4865395.006915.48710427.50595661.28
59450.0093446.4059450.0093446.4059450.0093446.4056477.5090258.3647560.0031783.68104037.50122042.04104037.50122042.0456477.5029473.5638642.5015741.1895120.0045214.7462422.5022693.8662422.5022693.86157542.5067908.6056477.5017952.7256477.5017952.7256477.5017952.7256477.5020002.4456477.5020002.4456477.5020002.4459450.0033814.8059450.0033814.8071340.0099368.6471340.0099368.64130790.00133183.4456477.5090894.4856477.5090894.4856477.5090894.4850532.505343.7850532.505343.7850532.505343.78671785.00550773.90
53505.0084101.7653505.0084101.7653505.0084101.7641615.0066506.1686202.5057607.92127817.50124114.08127817.50124114.0850532.5026371.0859450.0024217.20109982.5050588.2868367.5024855.1868367.5024855.18178350.0075443.4671340.0022677.1271340.0022677.1271340.0022677.1247560.0016844.1647560.0016844.1647560.0016844.1665395.0037196.2865395.0037196.2859450.0082807.2059450.0082807.20124845.00120003.4838642.5062190.9638642.5062190.9638642.5062190.9683230.008801.5283230.008801.5283230.008801.52725290.00514176.54
68367.50107463.3668367.50107463.3668367.50107463.3665395.00104509.6838642.5025824.24104037.50130333.92104037.50130333.9271340.0037229.7647560.0019373.76118900.0056603.5262422.5022693.8662422.5022693.86181322.5079297.3850532.5016062.9650532.5016062.9650532.5016062.9689175.0031582.8089175.0031582.8089175.0031582.8050532.5028742.5850532.5028742.5853505.0074526.4853505.0074526.48104037.50103269.0659450.0095678.4059450.0095678.4059450.0095678.4044587.504715.1044587.504715.1044587.504715.10701510.00568402.98
41615.0065412.4841615.0065412.4841615.0065412.4850532.5080757.4856477.5037743.12107010.00118500.60107010.00118500.6053505.0027922.3256477.5023006.34109982.5050928.6662422.5022693.8662422.5022693.86172405.0073622.5265395.0020787.3665395.0020787.3665395.0020787.3653505.0018949.6853505.0018949.6853505.0018949.6850532.5028742.5850532.5028742.5847560.0066245.7647560.0066245.7698092.5094988.3453505.0086110.5653505.0086110.5653505.0086110.5626752.502829.0626752.502829.0626752.502829.06618280.00481200.60
35670.0056067.8435670.0056067.8435670.0056067.8444587.5071256.6041615.0027810.7286202.5099067.3286202.5099067.3250532.5026371.0841615.0016952.0492147.5043323.1238642.5014048.5838642.5014048.58130790.0057371.7062422.5019842.4862422.5019842.4862422.5019842.4856477.5020002.4456477.5020002.4456477.5020002.4462422.5035505.5462422.5035505.5429725.0041403.6029725.0041403.6092147.5076909.1465395.00105246.2465395.00105246.2465395.00105246.2471340.007544.1671340.007544.1671340.007544.16600445.00442051.32
68367.50107463.3668367.50107463.3668367.50107463.3671340.00114010.5647560.0031783.68118900.00145794.24118900.00145794.2456477.5029473.5650532.5020584.62107010.0050058.1859450.0021613.2059450.0021613.20166460.0071671.3868367.5021732.2468367.5021732.2468367.5021732.2441615.0014738.6441615.0014738.6441615.0014738.6453505.0030433.3253505.0030433.3256477.5078666.8456477.5078666.84109982.50109100.1650532.5081326.6450532.5081326.6450532.5081326.6468367.507229.8268367.507229.8268367.507229.82692592.50559056.48
59450.0093446.4059450.0093446.4059450.0093446.4047560.0076007.0459450.0039729.60107010.00115736.64107010.00115736.6447560.0024819.8456477.5023006.34104037.5047826.1853505.0019451.8853505.0019451.88157542.5067278.0650532.5016062.9650532.5016062.9650532.5016062.9665395.0023160.7265395.0023160.7265395.0023160.7250532.5028742.5850532.5028742.5838642.5053824.6838642.5053824.6889175.0082567.2650532.5081326.6450532.5081326.6450532.5081326.6456477.505972.4656477.505972.4656477.505972.46636115.00485551.14
7076087.506069343.687076087.506069343.687076087.506069343.686960160.006075812.766546572.502497005.3613506732.508572818.1213506732.508572818.126567892.501903371.486731790.001519629.3013299682.503423000.786820965.001363792.926820965.001363792.9220120647.504786793.706654812.501182044.886654812.501182044.886654812.501182044.886488045.001274892.366488045.001274892.366488045.001274892.366882260.002133713.886882260.002133713.886511107.504989133.806511107.504989133.8013393367.507122847.686564920.005869869.846564920.005869869.846564920.005869869.846957290.00397640.106957290.00397640.106957290.00397640.1080761902.5035276250.36
Page size:
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB
This example presents how to create RadPivotGrid control and its structure dynamically on Page_Load event. When the control is declared statically and configured on Page_Load event, you should first add the fields to the RadPivotGrid Fields collection and after that set their properties. Also check the condition (Not IsPostBack) to avoid adding the same structure objects to the PivotGrid control twice.
   <telerik:RadPivotGrid runat="server" id="RadPivotGrid1"></telerik:RadPivotGrid> 
    C# 
    protected override void OnLoad(EventArgs e) 
    {     
        base.OnLoad(e);     
        if (!IsPostBack)     
        {         
            ...         
            PivotGridRowField rowField = new PivotGridRowField();
            RadPivotGrid1.Fields.Add(rowField);         
            rowField.DataField = "TransportType";         
            rowField.UniqueName = "TransportType";         
            rowField = new PivotGridRowField();         
            RadPivotGrid1.Fields.Add(rowField);         
            rowField.DataField = "Company";         
            rowField.UniqueName = "Company";         
            ...     
        } 
    }  

    VB 
    Protected Overrides Sub OnLoad(e As EventArgs)     MyBase.OnLoad(e)     
        If Not IsPostBack Then         
        ...         
        Dim rowField As New PivotGridRowField()         
        RadPivotGrid1.Fields.Add(rowField)        
        rowField.DataField = "TransportType"         
        rowField.UniqueName = "TransportType"         
        rowField = New PivotGridRowField()         
        RadPivotGrid1.Fields.Add(rowField)         
        rowField.DataField = "Company"         
        rowField.UniqueName = "Company"         
        ...     
        End If 
    End Sub 
  • DefaultCS.aspx
  • DefaultCS.aspx.cs
<%@ Page Language="c#" AutoEventWireup="false" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.GridExamplesCSharp.FirstLook.DefaultCS" %>

<%@ 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">
    <title>Telerik ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel ID="radAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
        <telerik:RadPivotGrid RenderMode="Lightweight" runat="server" ID="RadPivotGrid1">
        </telerik:RadPivotGrid>
    </telerik:RadAjaxPanel>
    </form>
</body>
</html>

Find Assistance

Help Us Improve

Was this example helpful?