Table of Contents

Class GuiGridView

Namespace
SapGui.Wrapper
Assembly
SapGui.Wrapper.dll

Wraps an ALV Grid View control (GuiGridView). This is the most common grid type in modern SAP transactions.

public class GuiGridView : GuiComponent
Inheritance
GuiGridView
Inherited Members

Properties

ColumnNames

Column names/keys available in this grid.

public IReadOnlyList<string> ColumnNames { get; }

Property Value

IReadOnlyList<string>

CurrentCellColumn

Column key of the currently focused cell.

public string CurrentCellColumn { get; }

Property Value

string

CurrentCellRow

Row index (0-based) of the currently focused cell.

public int CurrentCellRow { get; }

Property Value

int

FirstVisibleRow

Index of the first row currently visible in the viewport (0-based).

public int FirstVisibleRow { get; }

Property Value

int

RowCount

Total number of data rows.

public int RowCount { get; }

Property Value

int

SelectedRows

Returns the list of currently selected row indices (0-based).

public IReadOnlyList<int> SelectedRows { get; }

Property Value

IReadOnlyList<int>

VisibleRowCount

Number of rows currently visible in the viewport.

public int VisibleRowCount { get; }

Property Value

int

Methods

ClickCell(int, string)

Clicks a cell (e.g. to follow a tree-node or hyperlink).

public void ClickCell(int row, string column)

Parameters

row int
column string

DoubleClickCell(int, string)

Double-clicks a cell.

public void DoubleClickCell(int row, string column)

Parameters

row int
column string

GetCellCheckBoxValue(int, string)

Returns the boolean value of a checkbox-type cell.

public bool GetCellCheckBoxValue(int row, string columnName)

Parameters

row int
columnName string

Returns

bool

GetCellTooltip(int, string)

Returns the tooltip text for the specified cell.

public string GetCellTooltip(int row, string columnName)

Parameters

row int
columnName string

Returns

string

GetCellValue(int, string)

Returns the cell value at (row, columnName).

public string GetCellValue(int row, string columnName)

Parameters

row int
columnName string

Returns

string

GetRows(IEnumerable<string>?)

Reads all rows for the specified columns into a list of dictionaries. Scrolling is NOT performed automatically.

public List<Dictionary<string, string>> GetRows(IEnumerable<string>? columns = null)

Parameters

columns IEnumerable<string>

Returns

List<Dictionary<string, string>>

GetSymbolsForCell(int, string)

Returns the symbol/icon key for an icon-type column cell.

public string GetSymbolsForCell(int row, string columnName)

Parameters

row int
columnName string

Returns

string

PressEnter()

Confirms a cell edit by sending Enter to the grid.

public void PressEnter()

PressToolbarButton(string)

Presses a toolbar button by its function code string.

public void PressToolbarButton(string functionCode)

Parameters

functionCode string

SelectAll()

Selects all rows.

public void SelectAll()

SelectRow(int)

Selects a single row (0-based).

public void SelectRow(int row)

Parameters

row int

SetCellValue(int, string, string)

Sets the cell value at (row, columnName).

public void SetCellValue(int row, string columnName, string value)

Parameters

row int
columnName string
value string

SetCurrentCell(int, string)

Moves focus to the specified cell. Must be called before right-clicking, reading a tooltip, or reading a checkbox-type cell reliably.

public void SetCurrentCell(int row, string columnName)

Parameters

row int
columnName string