Jul 23, 2008 at 2:22 PM
Edited Jul 23, 2008 at 2:24 PM
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) ||
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.
Name: Properties Window
Bounding rectangle: 60,405,367,212
Bounding rectangle: 61,407,364,15
Bounding rectangle: 61,423,364,15
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.