Change text Grand Total

7 posts, 0 answers
  1. Roman
    Roman avatar
    10 posts
    Member since:
    Mar 2013

    Posted 03 Sep 2013 Link to this post

    How changing text "Grand Total"?
  2. Richard
    Richard avatar
    6 posts
    Member since:
    Nov 2016

    Posted 05 Dec 2016 Link to this post

    Hi,

    I know that this thread is very old one, but I don't see any other that could help me with it.

    I also want to change the text "GrandTotal" in one of my Pivot.

     

    "One of" is important, because I thought about using resources/localization but I don't see how to set this only to one Pivot.

     

    How can I achieve it?

  3. Dimitar
    Admin
    Dimitar avatar
    1621 posts

    Posted 05 Dec 2016 Link to this post

    Hello Richard,

    Thank you for writing.

    You can use the localization provider to change all strings used in RadPivotGrid: Localization.

    I hope this information is useful. 

    Regards,
    Dimitar
    Telerik
     
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
     
  4. Richard
    Richard avatar
    6 posts
    Member since:
    Nov 2016

    Posted 05 Dec 2016 in reply to Dimitar Link to this post

    Hi Dimitar,

    thanks for quick replay.

     

    If I understand, this will change text globally and I already looked at this.

    As I mentioned in my previous post, I want to change this text only in one Pivot, not in every single one in my app.

  5. Dimitar
    Admin
    Dimitar avatar
    1621 posts

    Posted 06 Dec 2016 Link to this post

    Hello Richard,

    To change this in particular control only, you can use the GroupElementFormatting event. For example:
    private void RadPivotGrid1_GroupElementFormatting(object sender, PivotGroupElementEventArgs e)
    {
        if (e.GroupElement.Text.Contains("Total"))
        {
            e.GroupElement.Text = "MyText";
        }
    }

    I hope this will be useful.

    Regards,
    Dimitar
    Telerik by Progress
    Telerik UI for WinForms is ready for Visual Studio 2017 RC! Learn more.
  6. Richard
    Richard avatar
    6 posts
    Member since:
    Nov 2016

    Posted 06 Dec 2016 in reply to Dimitar Link to this post

    Hi Dimitar,

    Thanks for replay and help.

    Your answer get me into right direction. Instead of checking if "string contain 'Total'" I check type of the group.

    Because if some field will contain "Total" (e.g. Total values) your code also will change it :)

     

    private void OnGroupElementFormatting(object sender, PivotGroupElementEventArgs e)
    {
        var element = e.GroupElement;
     
        if (element.Data.Group.Type == GroupType.GrandTotal)
            element.Text = "Total";
    }
  7. Dimitar
    Admin
    Dimitar avatar
    1621 posts

    Posted 06 Dec 2016 Link to this post

    Hello Richard,

    I am glad I could be of help. Let us know if you have any other questions.

    Regards,
    Dimitar
    Telerik by Progress
    Telerik UI for WinForms is ready for Visual Studio 2017 RC! Learn more.
Back to Top