Bug Report B97214
Visible to All Users

ActiveFilterString is not serialized

created 17 years ago

in Q22752, you state that we can create column filters on a GridView at design time using the popup menu item on the column. When I try this, I see the filter in the design time view, but when I run the program there is no filter. I don't believe that the designer source code is affected as I just tried it again when the source was locked and no files were checked out nor were any files marked as being dirty, nor were there any errors. As far as I can see there is no side effects to adding a column filter as design time (maybe I am doing something wrong).
I have attached the project I was working on (which was a user interface prototype). I was trying to add a filter that would hide rows with the "Resolution State" set to "Auto-Resolve".
Steps to Reproduce:

  1. Open the attached project and open the ConflictResolutionForm in design mode.
  2. Right click on the "ResolutionState" column to open the context menu and select the "Filter Editor" item.
  3. Create a filter of the type "Resolution State" does not equal "Auto-Resolve".
  4. You should see the filter in the footer of the grid view. Run the application. You will see the Auto-Resolve row in the grid view, but the filter is empty. If you add the filter descibed above at run time, it does hide the "Auto-Resolve" row.
    Actual Results:
    As far as I can see not design source code is added and there are no side effects to adding a filter at design time.
    Expected Results:
    I would like to be able to add a filter to the Grid veiw at design time as stated in Q22752.
Comments (3)
Stan (DevExpress Support) 17 years ago

    Hello Paul,
    Thank you for the report. Our developers have researched this problem and come to the conclusion that this behavior is by design. The current XtraGrid's architecture doesn't allow the active filter to be serialized at design-time, because it is necessary to refresh the grid after its data source is assigned. To resolve the problem, you should handle the Form's Load event and programmatically adjust the filter as shown below:

    C#
    this.conflictsGridView.ActiveFilterString = "[ResolutionState] <> 3";

    Please try this solution and inform us of your results.
    Thanks,
    Stan.

      Does this superseed the information given in Q22752? That is, is my case special or is not possible to assign filters to XtraGrid at run time?
      I am sure that this solution you give is adequate.

      Stan (DevExpress Support) 17 years ago

        Hello Paul,
        There is no any spatial in your case. The filtering at design time is a bad approach and I don't recommend you to use it. We'll try to find a solution, however the best way to resolve this issue is to apply filter at runtime.
        Thanks,
        Stan.

        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.