Help Center

Sortproperty

Sets a value that sorts selected rows according to selected criteria.

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 Sort (BYVAL settings AS SHORT)

Parameters

NameDescription
settingsOne of the constants listed below.
styleOne of the constants listed below.

Description

Sets a value that sorts selected rows according to selected criteria.

Remarks

The Sort property reorders rows based on values in specified columns. The rows to be sorted are determined by the Row and RowSel properties; if they are equal, all non-fixed rows are sorted. The columns used for sorting are defined by Col and ColSel. Sorting proceeds left-to-right across the selected columns

This property affects only the outer edge of the entire grid control. It does not control the lines between individual cells (gridlines).

While BorderStyle sets the outer frame, the Appearance property determines if that frame has a flat or 3D look.

The legacy MSHFlexGrid does not support complex outer borders like "Fixed3D" or "Inset" directly through the BorderStyle property alone; these effects are typically achieved by combining BorderStyle with the Appearance property.

Example

grid.Redraw = False ' Boost performance grid.Row = 1 ' Set range (Row 1 to last row) grid.RowSel = .Rows - 1 grid.Col = 1 ' Set sort key to Column 1 grid.ColSel = 1 grid.Sort = flexSortGenericDescending grid.Redraw = True

Reference