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
890
Headers are not refreshing after XamPivotGrid.DataSource.RefreshGrid()
posted

Hello,

  I have a XamPivotGrid, and when I update the grid, insteand of setting a new collection of ItemsSource of the FlatDataSource, I interates every item of the ItemsSource collection of FlatDataSource and then manually update the values. And then I do XamPivotGrid.DataSource.RefreshGrid(). This works globally but I have one problem: if in the grid I have drap several columns, the headers are not updating. I have attached a print screen of how it looks like the application. 

  As we can see, the column Amount for the asset AT0000385745 is not updated even if it is in the FlatDataSource, it stays at 356.062.

  Otherwise, if I save the layout and then set the entire ItesmSource of FlatDataSource and then restore the layout, it works. But this is not good because We want to avoid doing this when there's a lot of updates.

  Can you look into this? Thank you!

XamPivotGridRefreshProblem_HeadersNotUpdated.zip
  • 34850
    Offline posted

    Hello pebg,

    I have been investigating into this behavior that you are reporting, and it appears that changing the headers in the XamPivotGrid dynamically is not currently supported. It appears that the way that the hierarchical members (headers) of the Olap data sources work currently is that they are not loaded into the data source's "cube" until their "level" is expanded to. At this point, the members are loaded, and they become static. Up until this point, they can be changed, which you can see by starting up your application and forcing some of the headers that haven't yet been expanded to change. Once expanded though, these headers will reflect the value you have changed them to, but they will not be able to be changed further.

    In order to get the changes to be reflected on the headers, you need to do something along the lines of what you are currently doing, which in this case, is to rebuild the FlatDataSource. This can be done by assigning a new instance of the FlatDataSource to the XamPivotGrid's DataSource property, or by saving and loading a layout, which it appears you are currently doing.

    You had mentioned that this saving and loading layout is not exactly ideal for when there are a lot of updates, which I can certainly imagine. In this case, I would recommend deferring the updates to perhaps a "Refresh" type of button which would become enabled when there are changes to your FlatDataSource's cube. This would allow you to listen for the changes and allow your users to commit those changes at will.

    If you would like to see the ability to change the headers without rebuilding the data source, I would recommend suggesting a new product idea for this feature at http://ideas.infragistics.com. This product ideas site places you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community and user feedback.

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

    Sincerely,
    Andrew
    Associate Developer