Edit GrandTotalColumns in RadPivotGrid

2 posts, 0 answers
  1. Luis
    Luis avatar
    1 posts
    Member since:
    Jun 2013

    Posted 27 May 2014 Link to this post

    Hi everyone,

    I have 3 ​PivotGridAggregateField, the first is a quantity, second is a price, and third is a ​CalculationExpression, a multiplication between quantity and price. The problem i have, is in Grand Total Column, because the first and second grand total columns are ok, but third grand total column not, the result in this grand total column, is a multiplication between quantity grand total column and price grand total column. Can i edit this values or hide any grand total column or failing, edit aggregate functions in grand total columns?...


    Best regards. 
  2. Kostadin
    Kostadin avatar
    1733 posts

    Posted 30 May 2014 Link to this post

    Hello Luis,

    You could change the value of the GrandTotal cell on CellDataBinding event handler. Basically you have to check whether the currently cell is of type PivotGridDataCell and whether the cell is GrandTotalCell.  Additionally you could check the parent row and col indexes and this way to find whether the cell is the one which you want to modify. Please check out the following code snippet.
    protected void RadPivotGrid1_CellDataBound(object sender, Telerik.Web.UI.PivotGridCellDataBoundEventArgs e)
        if (e.Cell is PivotGridDataCell)
            PivotGridDataCell cell = e.Cell as PivotGridDataCell;
            string parentRowIndex = cell.ParentRowIndexes[0].ToString();
            string parentColIndex = cell.ParentColumnIndexes[0].ToString();
            if (parentRowIndex == "Black" && parentColIndex == "Grand Total" && cell.IsGrandTotalCell)
                cell.Text = "New Value";


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top