Hierarchical FlexGrid and a hierarchical Recordset combine hierarchical FlexGrid with a hierarchical Recordset to view information about the type of relationship. When you display this information to the user, you can ensure that the original data is secure so that it is not modified by the user, or you can increase the cell editing functionality of hierarchical FlexGrid by adding a text box to the form Defform. When hierarchical FlexGrid is bound to recordsets on a hierarchical structure, you can use bands to display grouped and related recordsets.
Note Before you perform this procedure, you must bind the data to hierarchical FlexGrid. To do this, see FlexGrid to bind data to a hierarchical structure.
Recordsets
1 to display the hierarchy in Hierarchical FlexGrid by using bands. Right-click Hierarchical FlexGrid and choose Properties from the shortcut menu. The Property Pages dialog box for Hierarchical FlexGrid appears.
2. On the General tab, set up band display. For a description of each stripe display, see Formatting for bands.
3. In the Band tab, select a band from the band Box. The available bands listed here are determined by the recordsets in the Command hierarchy. For each stripe, the name of the command that generates the recordset is displayed in parentheses.
4. Modify the properties of each stripe when necessary. For more information about this, see formatting for bands.
5. Click OK to apply the striped attribute to hierarchical FlexGrid and close the Property Pages dialog box.
Ribbon formatting
In Hierarchical FlexGrid, you can use the band formatting feature to specify the display options for a recordset. Each recordset in the ADO hierarchical structure Recordset is created with one stripe. For example, if you bind a hierarchical FlexGrid to an ADO hierarchy that contains Customers and Orders, then hierarchical FlexGrid will initially contain two bands.
You can customize the screen appearance of Hierarchical FlexGrid by formatting bands. This allows you to highlight important information in multiple bands. The stripe elements that are allowed to be formatted include the column headers, gridlines, colors, and indents.
If you bind to a recordset that is not hierarchical, then there is only one band in the control, and the band is called Band 0. There are no other bands, because the bands are based on the recordsets in the Command hierarchy.
Change the layout of a band
By changing the layout of the band, the field display in the band will change. By default, the fields in the stripe are arranged horizontally, as are the standard grids.
Band Display Horizontally
The vertical display will cause the band to expand in a high direction so that all the fields can be accommodated in the band. Other bands shown in the Hierarchical FlexGrid will also be extended to ensure that all bands are of the same height.
Vertical stripe display
To set a ribbon layout
1. Right-click Hierarchical FlexGrid and choose Properties from the shortcut menu. The Property Pages dialog box for Hierarchical FlexGrid appears.
2. Set up band display on the General tab.
3. Click OK to apply the striped display properties to hierarchical FlexGrid and close the Property Pages dialog box.
Show Column headers
If the stripe is displayed horizontally, you can set the header for the Hierarchical FlexGrid. The headers are displayed directly above the band, and are displayed once for each band in the Hierarchical FlexGrid. If you only need to display a set of headers for each band at the top and left of the hierarchical FlexGrid, use fixed cells instead of headers. For information about fixed cells, see Customizing fixed skins (in the theme custom Hierarchical FlexGrid area).
1. Right-click Hierarchical FlexGrid and choose "Implement" from the shortcut menu. The Property Pages dialog box for Hierarchical FlexGrid appears.
2. On the band tab, select column headers, and then select a column header style in the Textstyleheader list box.
3. Click OK to apply column header properties to Hierarchical FlexGrid and close the Property Pages dialog box.
Horizontal column headers
Change the Order of columns
The order of the columns in the Hierarchical FlexGrid zone can be changed.
To change the order of columns within bands
1. Select the columns you want to move.
2. Use the UP and DOWN ARROW keys to move the column to a new location in the band.
Modify colors and Gridlines
There are two ways to set the color and gridline information for bands: in whole and in individual ways. The purpose of modifying colors and gridlines is usually to highlight some important information within the hierarchical FlexGrid to make it easier for users to read the data. In addition, you can specify whether gridlines should be displayed between cells in the band. Use the following procedure to modify the colors and gridlines for all bands in the Hierarchical FlexGrid.
Note If you need to change the color information for a single stripe, you must use the Backcolorband property to programmatically change it.
To change the global color and grid lines
1. Right-click Hierarchical FlexGrid and choose Properties from the shortcut menu. The Property Pages dialog box for Hierarchical FlexGrid appears.
2. On the Band tab, select a style from the grid lines box, and then click Apply. For the selected band, the style determines the type of line in the hierarchical FlexGrid that is located between the standard filled text area.
3. On the Styles tab, select a style from fixed gridlines. Then select a style from the non-net grid line and click Apply. These styles determine the type of line in the Hierarchicalflexgrid that is located between the fixed and unfilled areas.
4. In the Color tab, specify a color for each gridline property. To do this, first select a color setting. Then select the properties you want to modify (for example, Gridcolor), select a color from the palette, and then click Apply. You need to repeat this action for each hierarchical FlexGrid grid line that needs to be changed.
Note If you use the Windows default color, the color displayed in Hierarchical FlexGrid will be the color specified in the Display Control Panel. In addition to changing the color of the Hierarchical FlexGrid property to a standard or Windows default color, you can create your own color definition (click Edit Custom color to use the Color dialog box that pops up).
5. Click OK to apply the gridlines and color properties to hierarchical FlexGrid and close the Property Pages dialog box.