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
1230
XamCalculationManager in Datapresenter (XamDataGrid) - firstly calculate formulas THEN filter
posted

i refer to this topic:

https://www.infragistics.com/community/forums/f/ultimate-ui-for-wpf/105688/xamdatagrid---xamcalculationmanager---filtering-on-a-calculated-column/504643?focus=true

We need to know how to apply this fix in the above support case.

we need our calculationmanager to apply filters AFTER all calculation just like in the case above, BUT our summaries should ONLY be done on filtered in records.

How do we go about doing both?

This is rather urgent!

Apparently there was a fix but what was fixed?

Parents
  • 34430
    Offline posted

    Hello Key360,

    I have been investigating into the behavior mentioned at the forum thread that you have linked, and I believe the fix that was made is something a little bit different to what you are looking to achieve in this case.

    Development issue 216439 mentioned in the other forum thread was fixed for the following scenario: “A filtered field, calculated by XamCalculationManager, does not get recalculated when the DataSource of the XamDataGrid has been re-assigned.” To me, this sounds a bit different to what you are asking here?

    Regarding the filtering of the grid being performed after the calculations are done, you can ensure that this happens by setting the XamDataGrid.FieldLayoutSettings.CalculationScope to “FullSortedList” as the calculations will then still take place on the elements that are filtered out if their data changes. Coming in the next service release for 18.1 and 18.2, there will also be a new property named XamDataGrid.FieldLayoutSettings.AssumeFilteredOutUntilInitialCalculationsComplete, which, when set to true, will filter out all records that aren’t calculated at the start and will then continue to bring records back in as the calculations complete for them.

    Another option that you may be able to use in this case is to handle the CalculationsCompleted event of the XamCalculationManager if you wish to wait until all calculations are complete before performing filtering. You can then apply a RecordFilter or enable the filter UI when this event fires.

    Where there may be issues in this case is the ability to have the summaries only take the filtered-in records while still performing calculations on filtered-out elements. Setting the XamDataGrid.FieldLayoutSettings.CalculationScope to “FullSortedList” will allow the calculations to take place on records that are filtered out, but it will also have the summaries take into account the full list as well. The best thing I can recommend at the moment to get around this is to set the XamDataGrid.FieldLayoutSettings.SummaryEvaluationMode to “Manual” and handle the QuerySummaryResult event to perform the summaries manually. I will be speaking with our development teams about a possible feature to have implemented to avoid this, though.

    I am attaching a sample project to demonstrate the above. Note, this project hooks the XamDataGrid.QuerySummaryResult event in the XamCalculationManager.CalculationsCompleted event as it will crash if you hook it from the grid. The AssumeFilteredOutUntilInitialCalculationsComplete event fixes this.

    I apologize for the long response, but I hope this helps. Please let me know if you have any other questions or concerns on this matter.

    XDGFilterCalculatedColumnAndSummaries.zip

Reply Children
No Data