Visual Basic Concepts

Using the Microsoft Hierarchical FlexGrid Control

The Microsoft Hierarchical FlexGrid (MSHFlexGrid) and Microsoft FlexGrid (MSFlexGrid) controls present Recordset data, from one or more tables, in a grid format.

The Hierarchical FlexGrid control provides you with advanced features for displaying data in a grid. It is similar to the Microsoft Data Bound grid (DataGrid) control, but with the distinct difference that the Hierarchical FlexGrid control does not allow the user to edit data bound to, or contained within, it. This control, therefore, allows you to display data to the user while ensuring that the original data remains secure and unchanged. It is also possible, however, to add cell-editing features to your Hierarchical FlexGrid control by combining it with a text box.

While the Hierarchical FlexGrid control is based on the FlexGrid control used in Visual Basic 5.0, the Hierarchical FlexGrid control is the more flexible of the two. The Hierarchical FlexGrid control also provides more display options with which you can define a custom format that best suits your needs.

These topics primarily focus on using the Hierarchical FlexGrid. For information on the former FlexGrid control, see your Visual Basic 5.0 documentation.

Visual Basic's FlexGrid controls

Icon Abbreviation Control Name
MSHFlexGrid control Microsoft Hierarchical FlexGrid control
MSFlexGrid control Microsoft FlexGrid control

The Hierarchical FlexGrid control supports the following features:

Note   To take advantage of the features marked with this symbol (*) you must use the Hierarchical FlexGrid control. These features are not available in the FlexGrid control.

Due to limitations of the previous FlexGrid control, some features, such as bands, are not accessible using this control. To have access to all features, we recommend that you use the Hierarchical FlexGrid control when creating a new data-bound grid control. The FlexGrid control does not automatically update to the Hierarchical FlexGrid control.

Accessing the Hierarchical FlexGrid Control

Use the following procedure to install and access the Hierarchical FlexGrid control in Visual Basic.

To install and access the Hierarchical FlexGrid control

  1. On the Project menu, select Components. The Components dialog box appears.

  2. On the Controls tab, select Microsoft Hierarchical FlexGrid Control 6.0, and then click OK. The MSHFlexGrid control is added to the Visual Basic toolbox.

  3. On the Visual Basic toolbox, click the MSHFlexGrid control, and then drop it on a Visual Basic form.

    -or-

    On the Visual Basic toolbox, double-click the MSHFlexGrid control to add it to a form.