We have an Infragistics UltraGrid control, and you can show a field chooser window for that grid.
However, the field chooser doesn't show up on the UIA automation tree. If I try searching for it programmatically then UIA doesn't find it, same if I try to manually look for it using UIA Verify.
But if I use UIA Verify hover/focus mode to find the field chooser, then it shows it, and also shows it under the same form as the grid control.
How do I find the control using code? Why doesn't it show up on the automation tree?
This appears to be a bug in the .NET framework related to forms created from MDI child forms. As a workaround, I've been able to use the AutomationElement.FromPoint() function.
Quoting from Guy Barker (Microsoft):
"I can reproduce the issue you’re seeing. I set the main to be a mdi container, and created a child form, whose MdiParent is the main form. I then added the original owned form as owned by the mdi child form. When I did this, I could get the details of the owned form in Inspect, but the form didn’t appear in the UIA tree view.
Interestingly, when I view the ancestors of the owned form, it lists the mdi child form as the parent as expected. But for some reason, the mdi child form doesn’t consider the owned form to be one of its children.
I don’t have any suggestions as to how to workaround this at the moment, but I’ll post a comment here if I do find something."