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

PropertyAggregateDescription as text

2 Answers 101 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
J
Top achievements
Rank 1
J asked on 20 Oct 2015, 10:20 AM
Hello,

I am about to end a WPF pivot but I still neeed one thing. In the code below you can see what I have already done but I would like the column "Description" to appear right where it is in the RadPivotGrid but I don't want it to be a Aggregate field. Now when the RadPivotGrid loads the data I can see "1" for every row in the column "Description" instead of the text. How should I define this field?

Thanks.

<pivot:LocalDataSourceProvider x:Key="dataProvider">
    <pivot:LocalDataSourceProvider.RowGroupDescriptions>
        <pivot:PropertyGroupDescription PropertyName="Type" />
        <pivot:PropertyGroupDescription PropertyName="Type2" />
    </pivot:LocalDataSourceProvider.RowGroupDescriptions>
     
    <pivot:LocalDataSourceProvider.AggregateDescriptions>
        <pivot:PropertyAggregateDescription PropertyName="Description"  />
        <pivot:PropertyAggregateDescription PropertyName="InitialDate" />
        <pivot:PropertyAggregateDescription PropertyName="Price" />
        <pivot:PropertyAggregateDescription PropertyName="Units" />
    </pivot:LocalDataSourceProvider.AggregateDescriptions>
</pivot:LocalDataSourceProvider>

2 Answers, 1 is accepted

Sort by
0
Accepted
Polya
Telerik team
answered on 21 Oct 2015, 11:44 AM
Hello J,

In order to use text as aggregate value for an aggregate description you should create a custom PropertyAggregateDescriptionBase that uses a custom AggregateFunction with a custom AggregateValue. We have a great example demonstrating how to achieve that in our QSF demos - the "Custom Aggregate Description" example.
I've prepared a sample project creating a custom StringAggregateDescription. You can find it attached.

Hope this helps.

Regards,
Polya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
J
Top achievements
Rank 1
answered on 21 Oct 2015, 11:52 AM

It's been very helpful! 

 Thanks.

Tags
PivotGrid
Asked by
J
Top achievements
Rank 1
Answers by
Polya
Telerik team
J
Top achievements
Rank 1
Share this question
or