DbHdrCtrlGrid component is much alike common DBCtrlGrid but additionally has got resizable multi-line headers for controls.

Screenshot of a DbHdrCtrlGrid

Screenshot of another DbHdrCtrlGrid

DbHdrCtrlGrid is freeware with source code. Complete source code for Delphi 4, 5, 6 and C++Builder 4, 5, 6 is available. The header file for C++Builder is available after compilation of the package. The current version is 1.1.

How to work with DbHdrCtrlGrid.

Put a DbHdrCtrlGrid component on the form. Set the DataSource property of the DbHdrCtrlGrid to the DataSource object that links to the DataSet the grid should fetch data from.

Drop some controls on the DbHdrCtrlGrid's panel and set their DataField properties to the appropriate fields. Adjust the PanelHeight property of the DbHdrCtrlGrid. Arrange the controls in parallel lines.

Double-click the DbHdrCtrlGrid component. In the Headers editor add as many headers as the count of lines of controls.

Select a header in the Headers editor and double-click Sections property in the Object Inspector. In the Sections editor add as many header sections as the count of controls in the corresponding line. Do not worry if the width of the panel changes to match the total width of the header.

Select a header section in the Sections editor and assign the required control to its Control property in the Object Inspector. Tune the Width, LeftMargin, and RightMargin properties. Set a title string to the Text property.

You can access any header section in a grid as Headers[I].Sections[J]. Each header is a Win32 common control. You can work with it the same way as with the generic THeaderControl component. The header section class is a descendant of the THeaderSection class.