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
860
FlatData Aggregators on load
posted

Hello

I have a PivotTable with a FlatDataSource. I´ve made a sample where it is possible to save the configuration, and it is possible to set the Aggregator type for each Measure. 

When I load the PivotTable next time I want to apply that aggregator. I use the FlatDataSource.LoadCustomization() to set the Measures.  

I´ve followed you example "FlatData Aggregators" and it works fine. However I can only get it to work if I do it after the load of the datasource. I does not work very well if I have multiple Measures. I am also thinking about performance. 

How do I apply the Aggregators in the load/initialization of the XamPivotGrid. I´ve tried multiple events but cannot find anything suitable.

Any suggestions?

Parents
No Data
Reply
  • 34810
    Verified Answer
    Offline posted

    Hello logimatic,

    In order to apply the aggregator on load of the XamPivotGrid and after the call to LoadCustomizations on your FlatDataSource, I would recommend using the ResultChanged event of the FlatDataSource that you are binding to your XamPivotGrid. This event fires whenever the Result property of the FlatDataSource changes, which will happen whenever you expand a measure, load your customizations, etc. Perhaps, if you were to hook this event just before you call the LoadCustomizations method and then unhook it after it fires, this would allow you to detect the ResultChanged event firing that happened as a result of loading your customizations. You could then apply your aggregator to your measures at that point.

    There is the possibility of a timing issue with this as well, and so I would recommend that you place the code inside of your ResultChanged event handler in a Dispatcher.BeginInvoke(new Action(() => { your code here })); statement. This should ensure that the measures of your FlatDataSource are loaded and should allow you to apply the appropriate aggregators to them.

    I hope this helps you. Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

Children
No Data