This is a migrated thread and some comments may be shown as answers.

Change text Grand Total

6 Answers 228 Views
PivotGrid and PivotFieldList
This is a migrated thread and some comments may be shown as answers.
Roman
Top achievements
Rank 1
Roman asked on 03 Sep 2013, 09:43 AM
How changing text "Grand Total"?

6 Answers, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 05 Dec 2016, 10:40 AM

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?

0
Dimitar
Telerik team
answered on 05 Dec 2016, 12:42 PM
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 >>
 
0
Richard
Top achievements
Rank 1
answered on 05 Dec 2016, 12:49 PM

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.

0
Dimitar
Telerik team
answered on 06 Dec 2016, 10:15 AM
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.
0
Richard
Top achievements
Rank 1
answered on 06 Dec 2016, 12:23 PM

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";
}
0
Dimitar
Telerik team
answered on 06 Dec 2016, 01:01 PM
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.
Tags
PivotGrid and PivotFieldList
Asked by
Roman
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Dimitar
Telerik team
Share this question
or