Customizing the PivotView on Page Load

Posted by: vahan on 3 August 2017, 3:57 pm EST

  • Posted 3 August 2017, 3:57 pm EST

    Hi,



    I am trying to customize the PivotView before users can use it by:



    - Checking the "Show expand glyphs" as default

    - Checking "Display Totals" as default when attributes are added in Row or Column shelves



    Any solutions?



    Thank you,

    Vahan
  • Replied 3 August 2017, 3:57 pm EST

    Vahan,

    You may customize the PivotView control as per your requirements using the following lines of code:

    protected void Page_Load(object sender, EventArgs e)
        {
            this.pivotView.AppearanceSettings.ExpandGlyphs = GrapeCity.ActiveAnalysis.Layout.ExpandGlyphsStyle.Default;
            this.pivotView.AppearanceSettings.TotalsPlacement = GrapeCity.ActiveAnalysis.Layout.TotalsPlacement.Default;
        }

    Regards,
    Sankalp
  • Replied 3 August 2017, 3:57 pm EST

    Hi,



    Thanks for the fast reply.

    The ExpandGlyphs property fixed my first problem. Thank you.

    The TotalsPlacement property is not what i wanted to change/modify. Attached is a screen shot of the property that i want to default to be checked when moving fields to the Row/Column shelves. Basically, I'm looking for a property which would set this as default or the event that is fired when row/column shelves are changed, so that i can call ILayoutActions.DisplayTotals method. Any hints?
    2011/02/DisplayTotalsSS.JPG
  • Replied 3 August 2017, 3:57 pm EST

    Vahan,

    If you are attempting to display the totals programmatically, you will need to call the DisplayTotals method of an ILayoutActions instance.  For example, to display the totals for the Category attribute (assuming it has already been placed on the row shelf) you could use code similar to the following:

            using (ILayoutActions la = pivotView.BeginLayoutUpdate("Display Totals"))
            {
               la.DisplayTotals "[Product].[Category]", DataDynamics.Analysis.Layout.ShelfKind.RowShelf);
                la.Commit();
            }

    Regards,
    Sankalp
  • Replied 3 August 2017, 3:57 pm EST

    I know that, the question is how can i do this automatically everytime an attribute placed on the Row/Column Shelf.
  • Replied 3 August 2017, 3:57 pm EST

    Vahan,

    Unfortunately currently there is no event which fires when the PivotView layout is changed in an ASP.NET application. I have however opened a new feature request Case 151860 for the development team to add such event to the PivotView. I have also added your E-mail address as an affected user to this case. You will be notified once this case gets resolved.

    Regards,
    Sankalp
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels