Ticket T1122933
Visible to All Users

PivotControl Filter is not set after RestoreLayout

created 2 years ago

Hello dear DevExpress team,
Unfortunately we have a small problem after switching from DevExpress 20.1.14 to 22.1.5

Attached is a small sample project. Repro steps:

  1. Debug the project
  2. Click the LoadLayout button
  3. The Filter is not Change to "Michael" (Only if the filter was previously empty)

Our PivotControl layouts are quite old and still contain the PreFilter (see T1071091) property. It only helps to reset the filter before loading the layout.

Best regards, Michael

Answers approved by DevExpress Support

created 2 years ago

Hello Michael,

Thank you for the project. It was helpful.

When a layout is restored, ActiveFilterString has a higher priority than the old PreFilter property. Thus, it will not be restored if ActiveFilterString is assigned. So, I recommend that you clear ActiveFilterString before restoring the layout:

C#
simpleButton2.Click += (s, e) => { pivotGridControl1.ActiveFilterString = String.Empty; pivotGridControl1.RestoreLayoutFromXml(xmlFilePath); };

This will allow you to restore the layout with the old PreFilter. Then re-save this layout with the ActiveFilterString property. I recorded a video to illustrate this.

Please try this and let us know your results.

    Comments (2)
    MM MM
    Michael Mickel 2 years ago

      Hello Igor, thank you very much for the detailed information and the video! It makes sense to me now =) I already use pivot.ActiveFilter.Clear() before loading the layout and it works great.

      Have a nice weekend, Michael

      DevExpress Support Team 2 years ago

        You are always welcome, Michael.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.