Help Center

ClearStucturefunction

Clears any mapping information from the MSHFlexGrid that regards the order and name of the displayed columns.

Windowsfunctiondoc-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

FUNCTION ClearStructure () AS HRESULT

Description

Reset the control's internal column mapping and band information when it is bound to a data source.

Remarks

Unlike the standard Clear method, which only empties cell content and formatting, ClearStructure removes the grid's underlying organizational metadata.

This method is primarily used in data-bound scenarios involving ADO or Shaped Recordsets.

When you change the RecordSource of a bound data control to a new query with a different number of columns or a different hierarchy (bands), the MSHFlexGrid often retains the column arrangement of the previous recordset.

Calling ClearStructure before assigning a new recordset forces the grid to "forget" its old layout and rebuild its columns and bands to match the new data structure automatically.

It is typically called immediately before setting a new DataSource or Recordset.

Reference