Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1145
Hide Row Totals on Single Elements
posted

This question was asked and answered within another post.  I am creating this post to expose it and provide value to other members as I believe the result of implementing this code provides a view that should be the default of the control because there is no need to show sums on a single row element. 

This question was answered by Mircho and Elena is going to copy his response to this post.

Many thanks.

Parents
  • 17559
    posted

    Hello All,

    Here is the exact quesiton that Jaime asked in the mentioned tread http://community.infragistics.com/forums/p/62354/317534.aspx#317534 :

    Hello again,

    I was not able to achieve the hiding of row totals only when the members being totalled are greater than a count of 1. This would be a great feature for your pivot grid. Having row totals only where there is more than one data element to total would mean more data to review on screen and less noise. I tried the following code but it hides all row totals in the heirarchy being expanded, not just ones where there is only one member to total:

     

    1. private void pivotGrid_LayoutLoaded(object sender, EventArgs e)
    2. {
    3. foreach (PivotDataRow r in pivotGrid.DataRows)
    4. {
    5. if (r.IsTotal & r.Tuple.Members.Count == 1)
    6. {
    7. r.IsVisible = false;
    8. }
    9. }
    10. }

    It seems that Tuple.Members.Count is always one, which I assume is the root element of each hierarchy being expanded? I was hoping for a way to get a count of what is being totaled, which yet may be possible?

Reply Children