Export (0) Print
Expand All

IGridProvider.GetItem Method

Retrieves the UI Automation provider for the specified cell.

Namespace:  System.Windows.Automation.Provider
Assembly:  UIAutomationProvider (in UIAutomationProvider.dll)

IRawElementProviderSimple GetItem(
	int row,
	int column
)

Parameters

row
Type: System.Int32

The ordinal number of the row of interest.

column
Type: System.Int32

The ordinal number of the column of interest.

Return Value

Type: System.Windows.Automation.Provider.IRawElementProviderSimple
The UI Automation provider for the specified cell.

  • Grid coordinates are zero-based with the upper left (or upper right cell depending on locale) having coordinates (0,0).

  • If a cell is empty a UI Automation provider must still be returned in order to support the ContainingGrid property for that cell. This is possible when the layout of child elements in the grid is similar to a ragged array.

Example of a Grid Control with Empty Coordinates

Windows Explorer view showing ragged layout.
  • Hidden rows and columns, depending on the provider implementation, can be loaded in the UI Automation tree and will therefore be reflected in the RowCount and ColumnCount properties. If the hidden rows and columns have not yet been loaded they should not be counted.

The following code is an example implementation of this method that returns an object representing the item at the specified location.

IRawElementProviderSimple IGridProvider.GetItem(int row, int column)
{
    return (IRawElementProviderSimple)gridItems[row, column];
}

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

Community Additions

ADD
Show:
© 2014 Microsoft