PropertyGrid does not work

Jul 23, 2008 at 2:22 PM
Edited Jul 23, 2008 at 2:24 PM
Hello,

i am trying to get the System.Windows.Forms.PropertyGrid properly working with White, but it seems that i have no success.
I am using the "Table" controlType to get an instance of the PropertyGrid.

Table propertyGrid = typesDialog.get<Table>(SearchCriteria.All.AndIndex(0))

The first problem i had was that i never got any rows, although there were still some in the grid.
So i started studying your source and i quickly discovered your TableRowFactor. Originally the rowPredicate just looks if the Name Starts with "Row " .. and so on.
The problem using the PropertyGrid is, that the this control has no "Row" string in its AutomationElements

So i modified the code (quick and dirty, just die see if it works) to get my rows anyway:

return (element.Current.Name.StartsWith("Row ") && element.Current.Name.Split(' ').Length == 2) ||
                            !element.Current.Name.Contains("Row");

This works but i just can't get the cells of a Column. Below you can see a Debug.Detail() Print of the PropertyGrid AutomationElement.
As you can see there are only two AutomationElements ("BaseClass", "General"). The "General" element is the 1st row and the represents the category.
The BaseClass ist the 2nd row and represents the first Property.

AutomationId: 1643276
ControlType: ControlType.Table
Name: Properties Window
HelpText:
Bounding rectangle: 60,405,367,212
ClassName: WindowsForms10.Window.8.app.0.3fbab22
IsOffScreen: False

    AutomationId:
    ControlType: ControlType.Custom
    Name: General
    HelpText:
    Bounding rectangle: 61,407,364,15
    ClassName:
    IsOffScreen: False

    AutomationId:
    ControlType: ControlType.Custom
    Name: BaseClass
    HelpText:
    Bounding rectangle: 61,423,364,15
    ClassName:
    IsOffScreen: False

Do you have any idea to get information about columns as well? Or is it not possible to get PropertyGrid working through microsoft doesn't expose enough accessibility/automation information.

seriously,
david