I've been developing an editor for a custom scripting language and I'm having a problem with AvalonDock v2 when I have two panes open. The problem arises when I have an AvalonEdit (WPF control) loaded in one pane and a DataGridView (WinForms control) loaded in the other. If I click on a cell in the DataGridView to edit it and then try to click on the AvalonEdit text document it won't set focus to the text document. In this case I am unable to type in the text document.
This doesn't happen if I have only a single pane open or if I have two AvalonEdit documents or two DataGridView controls on two panes.
Here is how the application is laid out: This is a Windows Forms application with an ElementHost to contain the AvalonDock control. I support two document types for this application, the AvalonEdit control as the text editor and a DataGridView as a RESX file editor. These are contained in a LayoutDocument. The AvalonEdit control works flawlessly, but I had some difficulty getting the DataGridView control to show up.
Originally I just set the Content property of the LayoutDocument to the DataGridView, but that just showed a blank tab. I then changed the Content to a WindowsFormsHost and set it's child property to the DataGridView. This worked and I was able to see and interact with the DataGridView. But I'm stuck with this weird focus issue.
I did a little testing and found the same behavior with a WPF and WinForms control in two panes. I used a WPF Textbox and a WinForms Textbox and saw the same thing.
Can anyone help me? I'm coming to the realization that I'll probably have to convert the application to WPF, but I thought I'd take one more stab at it.
Thanks, Rich