UI Automation Support for the Data Grid Control Type
This topic provides information about Microsoft UI Automation support for the Data Grid control type. In UI Automation, a control type is a set of conditions that a control must meet in order to use the ControlType
property. The conditions include specific guidelines for UI Automation tree structure, UI Automation property values and control patterns.
The Data Grid control type lets a user easily work with items that contain metadata represented in columns. Data grid controls have rows of items and columns of information about those items. A List View control in Microsoft Vista Explorer is an example that supports the Data Grid control type.
The following sections define the required UI Automation tree structure, properties, control patterns, and events for the Data Grid control type. The UI Automation requirements apply to all data grid controls, whether Windows Presentation Foundation (WPF), Win32, or Windows Forms.
This topic contains the following sections.
- Required UI Automation Tree Structure
- Required UI Automation Properties
- Required UI Automation Control Patterns
- Required UI Automation Events
- Date Grid Control Type Example
- Related Topics
Required UI Automation Tree Structure
The following table depicts the control view and the content view of the UI Automation tree that pertains to data grid controls and describes what can be contained in each view. For more information about the UI Automation tree, see UI Automation Tree Overview.
UI Automation Tree - Control View | UI Automation Tree - Content View |
---|---|
|
|
Required UI Automation Properties
The following table lists the properties whose value or definition is especially relevant to data grid controls. For more information on UI Automation properties, see UI Automation Properties for Clients.
Property | Value | Notes |
---|---|---|
See notes. |
The value of this property needs to be unique across all controls in an application. |
|
See notes. |
The outermost rectangle that contains the whole control. |
|
See notes. |
Supported if there is a bounding rectangle. If not every point within the bounding rectangle is clickable, and you perform specialized hit testing, then override and provide a clickable point. |
|
DataGrid |
This value is the same for all UI frameworks. |
|
True |
The value of this property must always be True. This means that the data grid control must always be in the content view of the UI Automation tree. |
|
True |
The value of this property must always be True. This means that the data grid control must always be in the control view of the UI Automation tree. |
|
See notes. |
If the control can receive keyboard focus, it must support this property. |
|
See notes. |
If there is a static text label then this property must expose a reference to that control. |
|
"data grid" |
Localized string corresponding to the data grid control type. |
|
See notes. |
The data grid control typically gets the value for its |
Required UI Automation Control Patterns
The following table lists the control patterns required to be supported by all data grid controls. For more information about control patterns, see UI Automation Control Patterns Overview.
Control Pattern Interface | Support/Value | Notes |
---|---|---|
Yes |
The data grid control itself always supports the Grid control pattern because the items that it contains have metadata that is laid out in a grid. |
|
Depends |
The ability to scroll the data grid depends on content and whether scroll bars are present. |
|
Yes |
All data grid controls contain items within it that are selectable. |
|
Yes |
The data grid control always has a header within its subtree so the Table control pattern must be supported. |
Data item controls within the data grid containers will support at a minimum:
Selection Item control pattern
Scroll Item control pattern (if container is scrollable)
The items within the data item container will support at a minimum:
Grid Item control pattern
Table Item control pattern
Required UI Automation Events
The following table lists the UI Automation events required to be supported by all data grid controls. For more information about events, see UI Automation Events Overview.
UI Automation Event | Support/Value | Notes |
---|---|---|
Required |
None |
|
BoundingRectangleProperty property-changed event. |
Required |
None |
IsEnabledProperty property-changed event. |
Required |
None |
IsOffscreenProperty property-changed event. |
Required |
None |
Depends |
None |
|
Required |
None |
|
CurrentViewProperty property-changed event. |
Depends |
None |
HorizontallyScrollableProperty property-changed event. |
Depends |
If the control supports the Scroll pattern, it must support this event. |
HorizontalScrollPercentProperty property-changed event. |
Depends |
If the control supports the Scroll pattern, it must support this event. |
HorizontalViewSizeProperty property-changed event. |
Depends |
If the control supports the Scroll pattern, it must support this event. |
VerticalScrollPercentProperty property-changed event. |
Depends |
If the control supports the Scroll pattern, it must support this event. |
VerticallyScrollableProperty property-changed event. |
Depends |
If the control supports the Scroll pattern, it must support this event. |
VerticalViewSizeProperty property-changed event. |
Depends |
If the control supports the Scroll pattern, it must support this event. |
Required |
None |
Date Grid Control Type Example
The following image illustrates a List View control that implements the Data Grid control type.
The control view and the content view of the UI Automation tree that pertains to the List View control is displayed below. The control patterns for each automation element are shown in parentheses.
UI Automation Tree - Control View | UI Automation Tree - Content View |
---|---|
DataGrid (Sort, Table, Selection, Grid)
|
Data Grid (Sort, Table, Selection, Grid)
|
The Data Item automation element can have the following children: Edit, Image, and Text.