Bug Report T297596
Visible to All Users

StackOverflowException is thrown in InplaceEditorBase when the RegisterUserEditor method is overridden

created 9 years ago (modified 9 years ago)

Hello Support Team,

currently we have an issue related to Editors having validation errors. In several programs we get a StackOverflowException. See attached a mini user dump using DebugDiag Tools and its report. Our programs open a so called sub program by replacing window content by content of the opened sub program. After user finished its actions in this sub program, it closes by replacing window content by the content of the calling (main) program back. When this steps done then we try to set the focus using mouse into a cell having a validation error. In some cases it sets the focus but cursor is not shown, in most cases it is unable to set the focus. When switching to another windows program and switching back, the program crashes with this stack overflow exception. Currently we are not able to reproduce this behavior in a sample application and can only give you the dump file generated by DebugDiag Tools. All we can see: the program calls InplaceEditorBase.scopeFocus_PreviewGotKeyboardFocus multiple times. A look into your source code shows that it runs into an endless loop when changing keyboard focus on a cell having a validation error…

Please feel free to ask, if an information is missing.

Regards
Steffen

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

    We are looking forward to your response, Steffen.
    Regards,
    Nadya

    JG JG
    Jan Graevenstein 9 years ago

      Hello Nadya and Andrey,
      finally I got a working example to reproduce this behavior using your WPF controls. Please see attachment for this sample. After some review I found a boolean field InplaceEditorBase.CloseEditorOnLostKeyboardFocus. I set it to true to solve my problems. But if switching back to the default behavior, the problem still exists. The sample solution demonstrates how to reproduce it.
      Following steps are necessary:

      1. Start the program
      2. Set focus on first cell of first row ("Text 1.1")
      3. Click the default button of this cell -> the sub program should open
      4. Switch back to main program by click on "Main program" button in upper left corner of the window
      5. Set focus by using mouse to first cell of second row ("Text 1.2")
        -> the cursor is not visible, entering text using keyboard not possible
      6. Switch to another windows program, e.g. Windows Explorer
      7. Switch back to the program, retry to set focus into first cell of second row and wait some seconds
        -> StackOverflowException should be thrown
        If the exception is not thrown for the first time, repeat this steps a second time.
        Some notes to the example code:
      8. BreadcrumbControl and BreadcrumbItem are the classes to open/close programs in one window shown on top of each window
      9. Programs are implemented using a UserControl which is applied to the MainProgramWindow, see MainProgramControl and SubProgramControl classes
      10. We use own "EditSettings" classes derived from ButtonEditSettings to override the editor, in the example I used a simple ButtonEdit
      11. The Row class is a "placeholder" storing our data from database and implements IDataErrorInfo to show validation errors in grid cells
        Some basic points must be matched to reproduce the StackOverflowException:
      12. sub program loading process must use a LoadingDecorator.
      13. EditSettings of the grid column must be overriden using EditorSettingsProvider.Default.RegisterUserEditor to register another editor
      14. a validation error must be visible in the focused cell
        Hope this helps you to find the cause of this StackOverflowException. I'm interested in removing the "hack" (InplaceEditorBase.CloseEditorOnLostKeyboardFocus = true) to switch back to your defaults.
        Thanks in advance
        Steffen
      DevExpress Support Team 9 years ago

        Hello Steffen,

        Thank you for your cooperation and the provided sample project. I was able to replicate the exception on my side. We will research it and let you know as soon as we obtain any results.

        Thanks,
        Michael

        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.