Bug Report T315526
Visible to All Users

GridView - Focused row is lost after grid filtering

created 9 years ago (modified 9 years ago)

We rely on GridView.FocusedRowChanged to refresh controls outside the grid with the related information. But the automatic row (re)focusing does not work consistently.
Consider the following scenario:

  1. Grid (with a pager, if it is releveant) is populated with 20 rows

  2. User clicks on the last row - it is now focused (GridView.FocusedRowChanged script is called and the rest of the screen changes accordingly)

  3. User changes something outside the grid (walks by the tree in our case) and this action calls GridView.PerformCallback()

  4. Number of rows in the grid is now less than before (let's say - 10) and the last row is automatically focused, but GridView.FocusedRowChanged script is NOT called!

  5. From now always, if user does something that changes row count to:
    >=10, then the 10th row is automatically selected
    <10, then focus is simply lost.
    But in any case GridView.FocusedRowChanged is never fired!

What worse is that GridView.GetFocusedRowIndex() continues to return 9 (10th row) even when grid is left with just single row!

Please, fix the behavior by always focusing a row, if any exists, and firing GridView.FocusedRowChanged whenever focused/selected row VISIBLY chanages.

Show previous comments (2)
Alessandro (DevExpress Support) 9 years ago

    Yes, in this scenario, it looks like thorough debugging is required to determine the cause of the issue. I am looking forward to your feedback once you have had the opportunity to prepare a sample project.

    BV BV
    Boris Verkhovykh 9 years ago

      Alessandro,
      Please play the scenario above with the attached demo.

      DevExpress Support Team 9 years ago

        Hello,

        Thank you for the project. I was able to reproduce the issue with using your code and I see that this is incorrect behavior and it should be investigated by our developers.
        I passed this ticket to our R&D team for further research. We will notify you as soon as we have results.

        Answers approved by DevExpress Support

        created 9 years ago (modified 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.