DbHdrCtrlGrid Component.

Freeware with source code. Version 1.1 for Delphi 4,5 and C++Builder 4.
http://www.dbaltgrid.com/freeware
Package file names are dhcg.dpk for Delphi and dhcgBCB.bpk for C++Builder.


SHORT DESCRIPTION.

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


HOW TO INSTALL COMPONENT.

1. Use "File\Open..." menu item of IDE to open either dhcg.dpk (for Delphi) or dhcgBCB.bpk (for C++Builder) package file typically located in the \Source directory. In Delphi 5 click "Yes" button in the dialog window prompting to convert package to the new format.
2. In the "Package..." window press "Install" button. A DbHdrCtrlGrid icon will appear on the "Samples" palette page.
3. Close the "Package..." window. Click "Yes" button in the dialog window prompting to save changes in the package project file.
4. You will have to update the "Library Path" string in "Tools\Environment Options..." under  the "Library" tab to include either DbHCGrid.dcu (for Delphi) or DbHCGrid.hpp (for C++Builder) file path.
5. If you find any problems during installation write us to: support@dbaltgrid.com


HOW TO UNINSTALL COMPONENT.

1. Select "Component" -> "Install Packages..." from the main menu.
2. Select the "DbHdrCtrlGrid" package and click "Remove" button. After package was removed, click "Ok" button to confirm your changes.
3. Remove either DbHCGrid.dcu (for Delphi) or DbHCGrid.hpp (for C++Builder) file path from "Library Path" string.


HOW TO WORK WITH DBHDRCTRLGRID.

  Place a DbHdrCtrlGrid component in a form. Set DataSource property to the TDataSource object that links to the dataset where the grid should fetch the data.
  Drop some controls on the DbHdrCtrlGrid's panel and set those DataField properties to appropriate fields. Adjust the DbHdrCtrlGrid's PanelHeight property. Arrange the controls in parallel lines.
  Double-click on the DbHdrCtrlGrid. In the Headers editor window add a new header for each line of controls.
  Select the header in the editor window and then double-click Sections property in the Object Inspector. In the Sections editor window add new header section for each control in the appropriate line. Don't worry when width of the panel will change to match the total width of the header.
  Select the header section in the editor window and assign a required control to the Control property in the Object Inspector. Adjust Width, LeftMargin, and RightMargin properties. Type in a title string in the Text property.


DECLARATIONS. 

TDbHdrCtrlGrid = class(TWinControl)  {Similar to common DBCtrlGrid. See the TDBCtrlGrid topic in the VCL help file.}
published
  property BorderStyle: TBorderStyle; {TBorderStyle = bsNone, bsSingle;}
  property PanelBorder: TDbHdrCtrlGridBorder;  {TDbHdrCtrlGridBorder = (gbNone, gbRaised, gbSingle);}
  property Headers: TdhcgHeaders;  {Collection of headers. Default property editor, launched when the component is double-clicked}
  property OnHeaderResize: TdhcgHeaderEvent;  {TdhcgHeaderEvent = procedure(DBCtrlGrid: TDbHdrCtrlGrid; Header: TdhcgHeader; Section: TdhcgSection) of object;}
  property OnHeaderClick: TdhcgHeaderEvent;  {See above.}

TdhcgHeaders = class(TCollection)
public
  function ControlToSection(AControl: TControl): TdhcgSection;  {Returns the section item attached to the control plased on the TDbHdrCtrlGrid's panel.}
  property Items[Index: Integer]: TdhcgHeader; default; {You can reference any header section in grid as Headers[I].Sections[J]. See the TdhcgSections.Items property.}
published
  property DefaultLeftMargin: Integer default -1; {Determines default LeftMargin value for new header section.}
  property DefaultRightMargin: Integer default 0; {Determines default RightMargin value for new header section.}

TdhcgHeader = class(TCollectionItem)
published
  property Sections: TdhcgSections; {Collection of header sections.}

TdhcgSections = class(TCollection)
public
  property Items[Index: Integer]: TdhcgSection; default; {You can reference any header section in  grid as Headers[I].Sections[J]. See the TdhcgHeaders.Items property.}

TdhcgSection = class(THeaderSection) {See the THeaderSection topic in the VCL help file.}
public
  function DataFieldName: string; {If control assigned to the Control property is data-aware, then function returns its DataField property value, otherwise null string}
published
  property Control: TControl; {Any control supported by DBCtrlGrid can be attached to header section.}
  property LeftMargin: Integer default -1; {Specifies the horizontal coordinate of the left edge of the Control relative to the left edge of the HeaderSection in pixels.}
  property RightMargin: Integer default 0;  {Specifies the horizontal coordinate of the right edge of the Control relative to the right edge of the HeaderSection in pixels.}

In C++Builder a DbHCGrid.hpp header file is available after compilation of the dhcgBCB.bpk package file.

LICENSE AGREEMENT

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appears in all copies. This
software is made available "as is", and AUTHOR DISCLAIMS
ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE,
INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL AUTHOR BE
LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, TORT (INCLUDING NEGLIGENCE) OR
STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.


DBALTGRID.

   Altive Software is pleased to announce DbAltGrid component. DbAltGrid allows a free-form layout and hierarchical columns structure in a DBGrid descendant.

   DbAltGrid adds the following features to the Borlands DBGrid:
* MULTIPLE LINES PER RECORD. Unlike DBGrid, which displays each record in a single row, DbAltGrid allows a free-form layout for each record in the dataset. You can customize layout not only at design time but also during runtime. This approach provides for an extremely efficient screen space use. 
* HIERARCHICAL COLUMNS STRUCTURE. Now you can sort your columns into logical categories, consolidate them and assign each column to a shared parent column. You can imitate a tree-like column structure that way. Such interface is similar to object and array field type interface of the Oracle 8 database, but you can emulate this powerful technique with any other database now. 
* DbAltGrid comes with a COMPONENT SET for displaying and editing numeric, Boolean, date, memo and graphic fields. It also includes a special component for displaying parent columns.
* ENHANCED COLUMN RESIZING AND MOVING. It is possible to resize and move any column both horizontally and vertically at design time as well as during runtime. DbAltGrid animates the column being moved with position indicators for sharper look and feel. 
* ROW RESIZING. A user can adjust the height of rows to meet his/her specific needs. Furthermore, your end-user can adjust the height of each line in the row separately. As well as you can do the same at design time. 
* Row height and column width can be FINE TUNED with a mouse double-click. 
* IMAGES IN COLUMN HEADERS. DbAltGrid has now got an Images property which allows you to attach an ImageList to the grid to display pictures in column headers. 
* Clickable button-like depressible column headers. HEADER ARROWS indicate the sorting column and the sorting order used. 
* Automatic WORD-WRAP in data cells. Ellipsis indicates when the text does not fit data cell or header. In that case you can see the full text in a HINT WINDOW. 
* Fast, smooth and flicker free painting. OFF-SCREEN PAINTING even by custom drawing in OnDrawColumnCell event handler. 
* Smart KEY MAPPING support. Optional Enter to Tab key automatic conversion. If you want, pressing the Down arrow key when the cursor is in the last record of the dataset does not result in appending a new empty record. It is made possible with a hot key use. 
* STRIPED LOOK. A background color of odd and even rows can be turned to alternate stripes like in ledger books. 
* HEADER CURSOR. Focus rectangle is drawn in the title cell of the selected column. 
* Support of TClientDataSet OBJECT FIELDS. Allows developers to use Non-BDE data sources. 
* Fully COMPATIBLE with DBGrid.

To learn more about DbAltGrid please visit us online at: http://www.dbaltgrid.com

Copyright 2000, Altive Software Ltd.