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

ConfigurationPanel Caption of Fields

2 Answers 84 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
SC
Top achievements
Rank 2
SC asked on 26 Feb 2013, 09:39 AM
Hello Everyone,

I'm having trouble in the following situation:

http://demos.telerik.com/aspnet-ajax/pivotgrid/examples/configurationpanel/defaultcs.aspx
On the Demo page I see a CategoryName & ProductName and so on...

In my application I've got the fields names separated with a "_" sign.

i would like to replace the "_" sign with an empty space " ". ex(Category_name => Category name)

I've tried to alter the column caption on databinding of the pivot grid (server side).
I've searched for a event (server side) prior to the Show of the configuration panel -> non existing.

can someone please point me in an other direction to search for the solution?

2 Answers, 1 is accepted

Sort by
0
SC
Top achievements
Rank 2
answered on 26 Feb 2013, 12:53 PM
I've found the solution:

by default the Caption field is empty.
To fill this execute the next steps:

1)On the PivotGrid bind the OnPreRender event.
2)On the server side event enter this code:

protected void RadPivotGridPreRender(object sender, EventArgs e)
 {
     for(int i = 0; i < oRadPivotGrid.Fields.Count; i++)
     {
         PivotGridField oPivotGridField = oRadPivotGrid.Fields[i];
         oPivotGridField.Fields[i].Caption = oPivotGridField.DataField.Replace("_", " ");
     }
 }


* note oRadPivotGrid is the PivotGrids ID defined on the aspx page.
0
Accepted
Maria Ilieva
Telerik team
answered on 01 Mar 2013, 11:06 AM
Hi Peter,

Thank you for sharing your solution.
I'm sure it will be of a big help to other users facing the same issue.

Greetings,
Maria Ilieva
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.
Tags
PivotGrid
Asked by
SC
Top achievements
Rank 2
Answers by
SC
Top achievements
Rank 2
Maria Ilieva
Telerik team
Share this question
or