Bug Report T295011
Visible to All Users

The IsFilterEnabled property value is invalid when the CustomRowFilter event is raised

created 9 years ago

We've noticed an issue with the GridControl where if you click to disable the filtering via the Checkbox in the lower left corner, then click into a Column's filter dropdown and select an item to filter by, the GridControl will re-enable the filtering, but it will not apply the filter.

Please refer to the attached sample for an example.
To reproduce this issue:

  1. Once the grid control has loaded, click into the Name column's filter dropdown and filter by any of the items
  2. Click the checkbox in the lower left corner to disable the filtering on the grid control
  3. Go back to the Name column, click into the filter dropdown again, and select another item to filter by
  4. Notice that the checkbox in the lower left is re-enabled, but the grid did not filter by the item you just selected

Debugging the code, after you have filtered by another item in step 3 the control will run through the CustomRowFilter method for each row in the grid, however, at this time the IsFilterEnabled property of the grid is still false, thus all rows are set to a visibility of true. In our case, we need this logic to stay as-is because we have our own extensive custom filtering code that we execute here. The issue here is that we should not even enumerate through this CustomRowFilter method for each row until after the IsFilterEnabled property is set back to true.

Hopefully this would be an easy fix on your end to have your controls set IsFilterEnabled to true before enumerating through your filtering logic, not after.

Thanks in advance!
Dan

PS  Apologies for the crude sample, I threw it together quickly using older samples I had from past support tickets

Show previous comments (1)

    "As I see, you are using a custom filter only when the IsFilterEnabled property is false"
    That is only for this simplified sample app. In our own application we start with this logic and immediately return from the method if filtering is not enabled. We have an elaborate set of filtering logic that we process which we would not want to execute if the Filtering is disabled.
    As it stands, this should be classified as a bug. If a new filter is applied and the filtering is re-enabled at the same time, than the logical order of your code should be to set the IsFilteringEnabled property to true, then apply the filter logic -- not the other way around. It doesn't make any sense in the current implementation.
    Considering this a bug, I don't think it's fair to say "we don't want to fix a bug because it might break other users' implementations".
    Hopefully you'd agree.
    Thanks!
    Dan

    DevExpress Support Team 9 years ago

      Hi Dan,
      Thank you the additional explanation. We agree with your point of view. With the current implementation, there is no proper way to check if a user disabled filter. I.e., if you manually filter grid rows, a user will be unable to quickly turn off the filter.
      After additional discussion, we concluded that it makes sense to set IsFilteringEnabled before raising CustomRowFilter. We will let you know once the fix is available.

        Great, thank you Ivan!

        Answers approved by DevExpress Support

        created 9 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          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.