New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

RowTableLayouts And Totals Placement Mode

empty
ProfitExpensesCountryCity
CompanyTransportType
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
SofiaParisAthensKavalaSzegedBresciaArgesBucharestMadridBrandon
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 Expenses
$59,450.00$93,446.40$59,450.00$93,446.40$127,817.50$146,225.76$127,817.50$146,225.76$133,762.50$60,615.54$53,505.00$19,451.88$187,267.50$80,067.42$44,587.50$14,173.20$44,587.50$14,173.20$29,725.00$10,527.60$29,725.00$10,527.60$59,450.00$33,814.80$65,395.00$91,087.92$124,845.00$124,902.72$62,422.50$100,462.32$62,422.50$100,462.32$53,505.00$5,658.12$53,505.00$5,658.12$689,620.00$575,463.54
$105,165.00$126,152.64$105,165.00$126,152.64$124,640.00$107,790.72$124,640.00$107,790.72$120,745.00$42,642.36$70,110.00$19,451.88$190,855.00$62,094.24$105,165.00$25,511.76$105,165.00$25,511.76$85,690.00$23,160.72$85,690.00$23,160.72$54,530.00$23,670.36$62,320.00$66,245.76$116,850.00$89,916.12$62,320.00$76,542.72$62,320.00$76,542.72$89,585.00$7,229.82$89,585.00$7,229.82$880,270.00$518,398.74
$54,530.00$88,774.08$54,530.00$88,774.08$111,930.00$127,224.00$111,930.00$127,224.00$109,060.00$52,820.28$66,010.00$24,855.18$175,070.00$77,675.46$45,920.00$15,118.08$45,920.00$15,118.08$63,140.00$23,160.72$63,140.00$23,160.72$40,180.00$23,670.36$86,100.00$124,210.80$126,280.00$147,881.16$57,400.00$95,678.40$57,400.00$95,678.40$48,790.00$5,343.78$48,790.00$5,343.78$683,060.00$580,855.68
$261,170.00$121,480.32$261,170.00$121,480.32$381,710.00$139,057.32$381,710.00$139,057.32$542,430.00$76,959.36$231,035.00$24,855.18$773,465.00$101,814.54$160,720.00$15,118.08$160,720.00$15,118.08$140,630.00$14,738.64$140,630.00$14,738.64$251,125.00$42,268.50$160,720.00$66,245.76$411,845.00$108,514.26$220,990.00$105,246.24$220,990.00$105,246.24$251,125.00$7,858.50$251,125.00$7,858.50$2,601,655.00$613,827.90
$150,675.00$98,118.72$150,675.00$98,118.72$287,000.00$126,446.52$287,000.00$126,446.52$229,600.00$43,172.46$172,200.00$25,935.84$401,800.00$69,108.30$136,325.00$17,952.72$136,325.00$17,952.72$107,625.00$15,791.40$107,625.00$15,791.40$121,975.00$28,742.58$93,275.00$53,824.68$215,250.00$82,567.26$121,975.00$81,326.64$121,975.00$81,326.64$143,500.00$6,286.80$143,500.00$6,286.80$1,564,150.00$497,598.36
$630,990.00$527,972.16$630,990.00$527,972.16$1,033,097.50$646,744.32$1,033,097.50$646,744.32$1,135,597.50$276,210.00$592,860.00$114,549.96$1,728,457.50$390,759.96$492,717.50$87,873.84$492,717.50$87,873.84$426,810.00$87,379.08$426,810.00$87,379.08$527,260.00$152,166.60$467,810.00$401,614.92$995,070.00$553,781.52$525,107.50$459,256.32$525,107.50$459,256.32$586,505.00$32,377.02$586,505.00$32,377.02$6,418,755.00$2,786,144.22
$65,395.00$102,791.04$65,395.00$102,791.04$154,570.00$191,743.68$154,570.00$191,743.68$101,065.00$46,615.32$62,422.50$22,693.86$163,487.50$69,309.18$65,395.00$20,787.36$65,395.00$20,787.36$32,697.50$11,580.36$32,697.50$11,580.36$44,587.50$25,361.10$47,560.00$66,245.76$92,147.50$91,606.86$65,395.00$105,246.24$65,395.00$105,246.24$32,697.50$3,457.74$32,697.50$3,457.74$671,785.00$596,522.46
$109,060.00$130,824.96$109,060.00$130,824.96$148,010.00$119,709.60$148,010.00$119,709.60$171,380.00$60,085.44$70,110.00$19,451.88$241,490.00$79,537.32$93,480.00$22,677.12$93,480.00$22,677.12$89,585.00$24,213.48$89,585.00$24,213.48$70,110.00$30,433.32$50,635.00$53,824.68$120,745.00$84,258.00$116,850.00$143,517.60$116,850.00$143,517.60$62,320.00$5,029.44$62,320.00$5,029.44$981,540.00$609,767.52
$43,050.00$70,084.80$43,050.00$70,084.80$134,890.00$167,991.48$134,890.00$167,991.48$132,020.00$63,868.68$74,620.00$28,097.16$206,640.00$91,965.84$54,530.00$17,952.72$54,530.00$17,952.72$57,400.00$21,055.20$57,400.00$21,055.20$51,660.00$30,433.32$54,530.00$78,666.84$106,190.00$109,100.16$66,010.00$110,030.16$66,010.00$110,030.16$68,880.00$7,544.16$68,880.00$7,544.16$737,590.00$595,724.52
$241,080.00$112,135.68$241,080.00$112,135.68$351,575.00$130,333.92$351,575.00$130,333.92$301,350.00$40,410.36$120,540.00$12,967.92$421,890.00$53,378.28$150,675.00$14,173.20$150,675.00$14,173.20$170,765.00$17,896.92$170,765.00$17,896.92$180,810.00$30,433.32$150,675.00$62,105.40$331,485.00$92,538.72$130,585.00$62,190.96$130,585.00$62,190.96$210,945.00$6,601.14$210,945.00$6,601.14$2,009,000.00$489,248.82
$157,850.00$102,791.04$157,850.00$102,791.04$272,650.00$144,585.24$272,650.00$144,585.24$308,525.00$59,214.96$165,025.00$24,855.18$473,550.00$84,070.14$172,200.00$22,677.12$172,200.00$22,677.12$143,500.00$21,055.20$143,500.00$21,055.20$143,500.00$33,814.80$93,275.00$53,824.68$236,775.00$87,639.48$86,100.00$57,407.04$86,100.00$57,407.04$107,625.00$4,715.10$107,625.00$4,715.10$1,650,250.00$524,940.36
$616,435.00$518,627.52$616,435.00$518,627.52$1,061,695.00$754,363.92$1,061,695.00$754,363.92$1,014,340.00$270,194.76$492,717.50$108,066.00$1,507,057.50$378,260.76$536,280.00$98,267.52$536,280.00$98,267.52$493,947.50$95,801.16$493,947.50$95,801.16$490,667.50$150,475.86$396,675.00$314,667.36$887,342.50$465,143.22$464,940.00$478,392.00$464,940.00$478,392.00$482,467.50$27,347.58$482,467.50$27,347.58$6,050,165.00$2,816,203.68
$59,450.00$93,446.40$59,450.00$93,446.40$133,762.50$172,310.40$133,762.50$172,310.40$121,872.50$56,112.48$50,532.50$18,371.22$172,405.00$74,483.70$62,422.50$19,842.48$62,422.50$19,842.48$26,752.50$9,474.84$26,752.50$9,474.84$74,312.50$42,268.50$44,587.50$62,105.40$118,900.00$104,373.90$71,340.00$114,814.08$71,340.00$114,814.08$65,395.00$6,915.48$65,395.00$6,915.48$710,427.50$595,661.28
$77,900.00$93,446.40$77,900.00$93,446.40$151,905.00$124,460.04$151,905.00$124,460.04$109,060.00$37,988.64$112,955.00$31,339.14$222,015.00$69,327.78$66,215.00$16,062.96$66,215.00$16,062.96$70,110.00$18,949.68$70,110.00$18,949.68$74,005.00$32,124.06$62,320.00$66,245.76$136,325.00$98,369.82$66,215.00$81,326.64$66,215.00$81,326.64$66,215.00$5,343.78$66,215.00$5,343.78$856,900.00$507,287.10
$45,920.00$74,757.12$45,920.00$74,757.12$114,800.00$134,738.40$114,800.00$134,738.40$111,930.00$55,052.28$43,050.00$16,209.90$154,980.00$71,262.18$80,360.00$26,456.64$80,360.00$26,456.64$80,360.00$29,477.28$80,360.00$29,477.28$51,660.00$30,433.32$63,140.00$91,087.92$114,800.00$121,521.24$40,180.00$66,974.88$40,180.00$66,974.88$40,180.00$4,400.76$40,180.00$4,400.76$671,580.00$529,588.50
$7,076,087.50$6,069,343.68$7,076,087.50$6,069,343.68$13,506,732.50$8,572,818.12$13,506,732.50$8,572,818.12$13,299,682.50$3,423,000.78$6,820,965.00$1,363,792.92$20,120,647.50$4,786,793.70$6,654,812.50$1,182,044.88$6,654,812.50$1,182,044.88$6,488,045.00$1,274,892.36$6,488,045.00$1,274,892.36$6,882,260.00$2,133,713.88$6,511,107.50$4,989,133.80$13,393,367.50$7,122,847.68$6,564,920.00$5,869,869.84$6,564,920.00$5,869,869.84$6,957,290.00$397,640.10$6,957,290.00$397,640.10$80,761,902.50$35,276,250.36
Advanced Services AceMicrovan
Minivan
Pickup
Truck
Van
Advanced Services Ace Total
Continential World CorpMicrovan
Minivan
Pickup
Truck
Van
Continential World Corp Total
Digital CorporateMicrovan
Minivan
Pickup
Grand Total
Page size:
  • Demo Configurator

This example demonstrates RowTable layouts and subtotals and grandtotals items placement mode in the RadPivotGrid controls. The possible options for the RowTableLayouts are: Tabular, Outline, Compact.

Each of them changes the rendering of the PivotGrid row table. The Tabular form could be used when you need all data to be presented in a traditional table format. The Outline layout could be used when you want to see the data in the classic PivotTable style. The Compact layout keeps related data by spreading it horizontally of the screen and helps for scrolling minimization.

Together with the RowTableLayouts the position of the subtotals and grandtotals items could be changed. The placement mode is controlled by four properties which are part of the TotalsSetting class:
  • RowsSubTotalsPosition - Gets or sets all rows subtotals items position
  • RowGrandTotalsPosition - Gets or sets row grandtotals item position
  • ColumnsSubTotalsPosition - Gets or sets all columns subtotals items position
  • ColumnGrandTotalsPosition - Gets or sets column grandtotals item position
Possible options for these properties are First, Last, None defined in Telerik.Web.UI.TotalsPosition enum. For example the following markup demonstrates how to hide all subtotals and gradntotals items:
<telerik:RadPivotGrid ID="RadPivotGrid1" runat="server">         
<TotalsSettings RowsSubTotalsPosition="None" RowGrandTotalsPosition="None"
ColumnsSubTotalsPosition="None" ColumnGrandTotalsPosition="None" />
    ...     
    
Please note that combination of TabularLayout and TotalsPosition.First is not supported(Like in Excel's PivotTable). If the TabularLayout is set and the TotalsPosition.First is choosen the subtotal items will be rendered after the groups like when TotalsPosition.Last is set.
  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • styles.css
<%@ Page Language="c#" AutoEventWireup="false" CodeFile="DefaultCS.aspx.cs" Inherits="Telerik.PivotGridExamplesCSharp.Appearance.SubtotalsAndGrandtotalsPlacementMode.DefaultCS" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" %>
<!DOCTYPE html>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
<div class="demo-container no-bg">
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ConfiguratorPanel1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadPivotGrid1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadPivotGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadPivotGrid1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadPivotGrid RenderMode="Lightweight" runat="server" ID="RadPivotGrid1" OnNeedDataSource="RadPivotGrid1_NeedDataSource"
        ShowFilterHeaderZone="false" AllowSorting="true" AllowPaging="true" PageSize="15">
        <Fields>
            <telerik:PivotGridRowField DataField="Company">
            </telerik:PivotGridRowField>
            <telerik:PivotGridRowField DataField="TransportType">
            </telerik:PivotGridRowField>
            <telerik:PivotGridColumnField DataField="Country">
            </telerik:PivotGridColumnField>
            <telerik:PivotGridColumnField DataField="City">
            </telerik:PivotGridColumnField>
            <telerik:PivotGridAggregateField DataField="Profit" Aggregate="Sum" DataFormatString="{0:C}">
            </telerik:PivotGridAggregateField>
            <telerik:PivotGridAggregateField DataField="Expenses" Aggregate="Sum" DataFormatString="{0:C}">
            </telerik:PivotGridAggregateField>
            <telerik:PivotGridAggregateField IsHidden="true" DataField="Expenses" Aggregate="Sum">
            </telerik:PivotGridAggregateField>
        </Fields>
    </telerik:RadPivotGrid>
    </div>
    <telerik:ConfiguratorPanel runat="server" ID="ConfiguratorPanel1">
        <Views>
            <qsf:View Title="Layout">
                <qsf:ConfiguratorColumn ID="ConfiguratorColumn1" runat="server" Size="Medium">
                    <ul class="fb-group">
                        <li>
                            <qsf:ComboBox AutoPostBack="true" runat="server" Size="Medium" Label="RowTableLayout:" ID="RadComboBoxTableLayout"
                                OnSelectedIndexChanged="RadComboBoxTableLayout_SelectedIndexChanged">
                                <Items>
                                    <telerik:RadComboBoxItem Text="Tabular" Value="Tabular" Selected="true"/>
                                    <telerik:RadComboBoxItem Text="Outline" Value="Outline" />
                                    <telerik:RadComboBoxItem Text="Compact" Value="Compact" />
                                </Items>
                            </qsf:ComboBox>
                            <qsf:ComboBox AutoPostBack="true" runat="server" Size="Medium" Label="Aggregates position:" ID="RadComboBoxAggregatesPosition"
                                OnSelectedIndexChanged="RadComboBoxAggregatesPosition_SelectedIndexChanged">
                                <Items>
                                    <telerik:RadComboBoxItem Text="Columns" Value="Columns" Selected="true"/>
                                    <telerik:RadComboBoxItem Text="Rows" Value="Rows" />
                                </Items>
                            </qsf:ComboBox>
                        </li>
                    </ul>
                </qsf:ConfiguratorColumn>
            </qsf:View>
            <qsf:View Title="Row Totals">
                <qsf:ConfiguratorColumn ID="ConfiguratorColumn2" runat="server" Size="Medium">
                    <ul class="fb-group">
                        <li>
                            <qsf:ComboBox AutoPostBack="true" Label="Subtotals:" Size="Medium" runat="server" ID="RadComboBoxRowSubtotalsPosition"
                                OnSelectedIndexChanged="RadComboBoxRowSubtotalsPosition_SelectedIndexChanged">
                                <Items>
                                    <telerik:RadComboBoxItem Text="Last" Value="Last" Selected="true"/>
                                    <telerik:RadComboBoxItem Text="None" Value="None" />
                                    <telerik:RadComboBoxItem Text="First" Value="First" />
                                </Items>
                            </qsf:ComboBox>
                            <qsf:ComboBox AutoPostBack="true" runat="server" Size="Medium" Label="Grandtotals:" ID="RadComboBoxRowGrandTotalsPosition"
                                OnSelectedIndexChanged="RadComboBoxRowGrandTotalsPosition_SelectedIndexChanged">
                                <Items>
                                    <telerik:RadComboBoxItem Text="Last" Value="Last" Selected="true"/>
                                    <telerik:RadComboBoxItem Text="None" Value="None" />
                                    <telerik:RadComboBoxItem Text="First" Value="First" />
                                </Items>
                            </qsf:ComboBox>
                        </li>
                    </ul>
                </qsf:ConfiguratorColumn>
            </qsf:View>
            <qsf:View Title="Column Totals">
                <qsf:ConfiguratorColumn ID="ConfiguratorColumn3" runat="server" Size="Medium">
                    <ul class="fb-group">
                        <li>
                            <qsf:ComboBox AutoPostBack="true" runat="server" Size="Medium" Label="Subtotals:" ID="RadComboBoxColumnSubtotalsPosition"
                                OnSelectedIndexChanged="RadComboBoxColumnSubtotalsPosition_SelectedIndexChanged">
                                <Items>
                                    <telerik:RadComboBoxItem Text="Last" Value="Last" Selected="true"/>
                                    <telerik:RadComboBoxItem Text="None" Value="None" />
                                </Items>
                            </qsf:ComboBox>
                            <qsf:ComboBox AutoPostBack="true" runat="server" Size="Medium" Label="Grandtotals:" ID="RadComboBoxColumnGrandTotalsPosition"
                                OnSelectedIndexChanged="RadComboBoxColumnGrandTotalsPosition_SelectedIndexChanged">
                                <Items>
                                    <telerik:RadComboBoxItem Text="Last" Value="Last" Selected="true"/>
                                    <telerik:RadComboBoxItem Text="None" Value="None" />
                                    <telerik:RadComboBoxItem Text="First" Value="First" />
                                </Items>
                            </qsf:ComboBox>
                        </li>
                    </ul>
                </qsf:ConfiguratorColumn>
            </qsf:View>
        </Views>
    </telerik:ConfiguratorPanel>
    </form>
</body>
</html>

Support & Learning Resources

Find Assistance