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

Values in Column Labels...

1 Answer 77 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Juan
Top achievements
Rank 1
Juan asked on 13 May 2016, 09:48 PM

Hello all, 

wonder if someone can help me to find the solution for get 'PropertyAggregateDescription' into a 'ColumnGroupDescriptions'. This is my code:

    <Window.Resources>
        <pivot:LocalDataSourceProvider x:Key="LocalDataProvider" AggregatesPosition="Rows">
            <pivot:LocalDataSourceProvider.RowGroupDescriptions>
                <pivot:PropertyGroupDescription PropertyName="Product Line"  />
            </pivot:LocalDataSourceProvider.RowGroupDescriptions>
            <pivot:LocalDataSourceProvider.ColumnGroupDescriptions>
                <pivot:PropertyGroupDescription PropertyName="Value:Net Revenue - Total"  />
            </pivot:LocalDataSourceProvider.ColumnGroupDescriptions>
            <pivot:LocalDataSourceProvider.AggregateDescriptions>
                <pivot:PropertyAggregateDescription PropertyName="Net Revenue - Total" StringFormat="C" AggregateFunction="Sum" />
                <pivot:PropertyAggregateDescription PropertyName="Cost Total" StringFormat="C" AggregateFunction="Sum"/>
                <pivot:PropertyAggregateDescription PropertyName="GM $" StringFormat="C" AggregateFunction="Sum"/>
                <pivot:PropertyAggregateDescription PropertyName="GM %" StringFormat="P" AggregateFunction="Sum"/>
            </pivot:LocalDataSourceProvider.AggregateDescriptions>
        </pivot:LocalDataSourceProvider>
    </Window.Resources>

 

And if you see 'Problem.png' image is what i get. But I want something like the send image 'ThisIsWhatIWant.png', I can do it if I modify my Pivot with the FieldList in run time, just draggin the Values item into 'Column Labels', I need to have this in XAML or C# code, I think that it's something simple, but I just can't do it ):

 

Can someone help me?

1 Answer, 1 is accepted

Sort by
0
Polya
Telerik team
answered on 18 May 2016, 11:19 AM
Hello Juan,

The AggregatesPosition property indicates where the aggregate groups should be positioned. In your case it is set to Rows, which means that the aggregate groups will be displayed in rows.
Changing this value to Columns should do the trick.

<pivot:LocalDataSourceProvider x:Key="LocalDataProvider" AggregatesPosition="Columns">
    <!--...-->
</pivot:LocalDataSourceProvider>

Hope this helps.

Regards,
Polya
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
PivotGrid
Asked by
Juan
Top achievements
Rank 1
Answers by
Polya
Telerik team
Share this question
or