ConfigurationPanel Caption of Fields

3 posts, 1 answers
  1. SC
    SC avatar
    9 posts
    Member since:
    Nov 2008

    Posted 26 Feb 2013 Link to this post

    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. SC
    SC avatar
    9 posts
    Member since:
    Nov 2008

    Posted 26 Feb 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 01 Mar 2013 Link to this post

    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.
Back to Top