6 Answers, 1 is accepted

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?
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
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 >>

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.
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

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"
;
}
I am glad I could be of help. Let us know if you have any other questions.
Regards,
Dimitar
Telerik by Progress