Radpivotgrid Export problem

5 posts, 0 answers
  1. Hiram
    Hiram avatar
    6 posts
    Member since:
    May 2015

    Posted 07 May 2015 Link to this post

    Hi

     Im working with the radpivotgrid, i change some column names in the pivot in the CellDataBound event (like Kostadin explains in this example http://www.telerik.com/forums/edit-grandtotalcolumns-in-radpivotgrid) and works fine, the problem is when i try to export to an Excel file, all the data is exported fine, except the column names that i edited, the column names in the exported excel file dont have the changes i maded, and other thing, there is a way to hide the columns of a PivotGridAggregateField and show only the grand total of this same field?

  2. Kostadin
    Admin
    Kostadin avatar
    1709 posts

    Posted 12 May 2015 Link to this post

    Hello Hiram,

    I am afraid that the changes are not persisted in the exported file and you have to add them again during the exporting. For this purpose you need to OnPivotGridCellExporting and use almost the same code as the one from the other forum thread. Please check out the following code snippet.
    protected void RadPivotGrid1_PivotGridCellExporting(object sender, PivotGridCellExportingArgs e)
    {
        if (e.PivotGridCell is PivotGridDataCell)
        {
            PivotGridDataCell cell = e.PivotGridCell as PivotGridDataCell;
            string parentRowIndex = cell.ParentRowIndexes[0].ToString();
            string parentColIndex = cell.ParentColumnIndexes[0].ToString();
            if (parentRowIndex == "Black" && parentColIndex == "Grand Total" && cell.IsGrandTotalCell)
            {
                e.ExportedCell.Value = "New Value";
            }
        }
    }

    Regards your second question I am afraid you could not hide the PivotGridAggregateField data and show only the grand total value.

    Regards,
    Kostadin
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Hiram
    Hiram avatar
    6 posts
    Member since:
    May 2015

    Posted 12 May 2015 in reply to Kostadin Link to this post

    Thanks for your quick response, but there is no PivotGridCell property in "e" in that event, only ExportedCell and PivotGridModelCell, and the conversion fails to PivotGridDataCell. I can use the IsGrandTotalCell in the PivotGridModelCell, but i need too the missing ParentRowIndexes property to complete my task.
  5. Hiram
    Hiram avatar
    6 posts
    Member since:
    May 2015

    Posted 12 May 2015 in reply to Kostadin Link to this post

    thanks for your response, but i cant find the property PivotGridCell in "e" in this event, only ExportedCell and PivotGridModelCell, i can use the IsGrandTotalCell in the PivotGridModelCell but i really need the ParentColumnIndexes too to complete my task
  6. Kostadin
    Admin
    Kostadin avatar
    1709 posts

    Posted 15 May 2015 Link to this post

    Hi Hiram,

    Note that PivotGridCell object is supported since Q1 2015 version of the controls and in case you are using an older version I would recommend you to upgrade at least to this version.

    Regards,
    Kostadin
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017