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

How do I customize the column header?

4 Answers 275 Views
PivotGrid and PivotFieldList
This is a migrated thread and some comments may be shown as answers.
Joseph
Top achievements
Rank 1
Joseph asked on 06 Feb 2013, 04:11 PM
I have a column that sums the "rev" field.  The heading reads "Sum of rev".  For consistency with existing reports, I would like that to read "Total Revenue", but I can't find the property or event where I can change it.

4 Answers, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 11 Feb 2013, 09:57 AM
Hello Joseph,

Thank you for writing.

If you want to change the text of the column's header, you can do that by setting the column's
HeaderText property. You can refer the online documentation regarding this.

I hope this helps.

All the best,
Svett
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
0
Stefan
Telerik team
answered on 11 Feb 2013, 11:07 AM
Let me follow up on this case. In the previous post, by mistake you was provided with information how to set the header text in RadGridView not in RadPivotGrid. 

To do that in RadPivotGrid you have to use the CustomName property of the PropertyAggregateDescriptor:
this.radPivotGrid1.AggregateDescriptions.Add(new PropertyAggregateDescription() { PropertyName = "Freight", AggregateFunction = AggregateFunctions.Sum, CustomName = "this is the custom header text" });

I hope this helps.
 
Kind regards,
Stefan
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
0
steven littleford
Top achievements
Rank 1
answered on 28 Nov 2013, 12:07 AM

If you want to do it on the fly based on the data then you need to use the 

GroupElementFormatting 

event.....

However, there seem to be no way to find out what group the e.GroupElement belongs to.....

stefan, any ideas here?


0
Stefan
Telerik team
answered on 02 Dec 2013, 07:18 AM
Hello Steven,

As you were informed in the other thread you asked this question in, you can access the group in the GroupElementFormatting event handler with the following line of code:
IGroup group = e.GroupElement.Data.Group;

Regards,
Stefan
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 >>


Tags
PivotGrid and PivotFieldList
Asked by
Joseph
Top achievements
Rank 1
Answers by
Svett
Telerik team
Stefan
Telerik team
steven littleford
Top achievements
Rank 1
Share this question
or