Help Center

RowPositionproperty

Sets the position of an MSHFlexGrid row, allowing you to move rows to specific positions.

Windowspropertydoc-orphan
No implementation located. This member is documented, but the source scan found no matching declaration. It is likely declared in a header this scan does not resolve, or provided by a macro.

Syntax

PROPERTY RowPosition (BYVAL Index AS LONG, BYVAL newPos AS LONG) AS LONG

Parameters

NameDescription
IndexThe current zero-based index of the row you wish to move.
newPosThe target zero-based index where the row should be placed.

Description

Sets the position of an MSHFlexGrid row, allowing you to move rows to specific positions

Remarks

Unlike the RowPos property (which returns a coordinate), RowPosition is a write-only property used to reorder rows.

When a row is moved, the other rows automatically shift to accommodate the change. For example, moving Row 5 to Position 1 will push the original Row 1 down to Position 2.

Moving a row via RowPosition preserves all cell contents, individual cell formatting (CellBackColor, etc.), and row-specific metadata.

In a hierarchical display, RowPosition typically operates within the context of the current band or the top-level structure.

Examples

' Moves the row currently at index 9 to index 1 grid.RowPosition(9) = 1

' Moving Row 2 to Position 3 effectively swaps them grid.RowPosition(2) = 3

Reference