PropertyAggregateDescription as text

3 posts, 1 answers
  1. J
    J avatar
    11 posts
    Member since:
    Sep 2015

    Posted 20 Oct 2015 Link to this post

    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. Answer
    Polya
    Admin
    Polya avatar
    199 posts

    Posted 21 Oct 2015 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. J
    J avatar
    11 posts
    Member since:
    Sep 2015

    Posted 21 Oct 2015 in reply to Polya Link to this post

    It's been very helpful! 

     Thanks.

Back to Top