Change "Sum of {0}" text

6 posts, 1 answers
  1. Barbaros Saglamtimur
    Barbaros Saglamtimur avatar
    110 posts
    Member since:
    Jul 2012

    Posted 08 Aug 2012 Link to this post

    Hi,
    If there is more than one  PivotGridAggregateField (lets say Aggregate="Sum") it adds "Sum of <filedname>" header.
    So how can I change "Sum of <filedname>" and more over; "{0} Total" , "Grand Total" texts? I need to localize those strings.

    TIA
  2. Joao
    Joao avatar
    14 posts
    Member since:
    Feb 2011

    Posted 21 Aug 2012 Link to this post

    I´m having the same problem... neither in portuguese nor in spanish the used legend goes well... any workaround? Thanks!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 24 Aug 2012 Link to this post

    Hi,

    Please note that at the present time the RadPivotGrid control is in CTP version and does not have many of the functionalities which will be available via properties at its official release.

    Nevertheless, you could try to apply the requested localization using the following approach:
      mark-up:
    <telerik:PivotGridAggregateField DataField="TotalPrice" Aggregate="Sum" DataFormatString="{0:C}"
         GrandTotalAggregateFormatString="Gemeinsam: {0}" TotalFormatString="Gesamt: {0}">
     </telerik:PivotGridAggregateField>
      C#:
    protected void RadPivotGrid1_CellDataBound(object sender, PivotGridCellDataBoundEventArgs e)
    {
        if (e.Cell is PivotGridRowHeaderCell)
        {
            if (e.Cell.Text.IndexOf("Grand Total") >= 0)
            {
                e.Cell.Text = "Gesamtsumme:";
            }
        }
     
        else if (e.Cell is PivotGridColumnHeaderCell)
        {
            int index = e.Cell.Text.IndexOf("Total Sum of");
            if (index >= 0)
            {
                e.Cell.Text = e.Cell.Text.Replace("Total Sum of", "Gesamt Summe der");
            }
            else
            {
                index = e.Cell.Text.IndexOf("Sum of");
                if (index >= 0)
                {
                    e.Cell.Text = e.Cell.Text.Replace("Sum of", "Summe der");
                }
            }
     
        }
    }

    That should do the trick. Please give it a try and let me know about the result.

    Greetings,
    Eyup
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Joao
    Joao avatar
    14 posts
    Member since:
    Feb 2011

    Posted 24 Aug 2012 Link to this post

    Thaks so much Eyup!
    Your solution solved quickly and in an elegant way this barrier of the version. I kown it is CTP but coudn't avoid using it because it's simple, pleasant and, above all, very powerfull.
    Best regards!
    Joao
  6. Nils C.
    Nils C. avatar
    41 posts
    Member since:
    Oct 2009

    Posted 29 May 2013 Link to this post

    Hi,

    the "Grand Total" string is still missing in the localisation file or do i miss something?

    Best 

    Nils
  7. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 31 May 2013 Link to this post

    Hi Nils,

    Currently, you will need to modify this text programmatically. You can log this requirement as a feature request so our developers will consider including it for the future releases:
    http://feedback.telerik.com/Project/108/Feedback/List/Feature%20Request

    Thank you for the feedback.

    Regards,
    Eyup
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017