Delphi 的 TDBGrid 支持表头的合并和多行显示。可以看看帮助中的说明。Depending on the value of the dataset抯 ObjectView property, a grid displays ADT and array fields either flattened out, or in an object mode, where the field can be expanded and collapsed. When ObjectView is True, the object fields can be expanded and collapsed. When a field is expanded, each child field appears in its own column with a title bar, which are below the title bar of the ADT or array field itself. When the field is collapsed, only one column appears with an uneditable comma delimited string containing the child fields. A column can be expanded and collapsed by clicking on the arrow in the title bar of the field, and by setting the Expanded property of the column. When the dataset抯 ObjectView property is False, each child field appears in a separate column.Property Object Purpose Expandable TColumn Specifies whether the column can be expanded to show child fields in separate, editable columns. Expanded TColumn Specifies whether the column is expanded. MaxTitleRows TDBGrid Specifies the maximum number of title rows that can appear in the grid. ObjectView TDataSet Specifies whether fields are displayed flattened out, or in an object mode, where each object field can be expanded and collapsed. ParentColumn TColumn Refers to the TColumn object that owns the child field抯 column. The following figure shows the grid with an ADT field and an array field. The dataset抯 ObjectView property is set to False so that each child field has a column.The following figures show the grid with an ADT field and an array field. The first figure shows the fields collapsed. In this state they cannot be edited. The second figure shows the fields expanded. The fields are expanded and collapsed by clicking on the arrow in the fields title bar.
我这有原码,要的话发邮件给我。[email protected]
关于表头
dbgrideh可能是第三方控件,6里面是没有的
关于表头
Expandable TColumn Specifies whether the column can be expanded to show child fields in separate, editable columns.
Expanded TColumn Specifies whether the column is expanded.
MaxTitleRows TDBGrid Specifies the maximum number of title rows that can appear in the grid.
ObjectView TDataSet Specifies whether fields are displayed flattened out, or in an object mode, where each object field can be expanded and collapsed.
ParentColumn TColumn Refers to the TColumn object that owns the child field抯 column.
The following figure shows the grid with an ADT field and an array field. The dataset抯 ObjectView property is set to False so that each child field has a column.The following figures show the grid with an ADT field and an array field. The first figure shows the fields collapsed. In this state they cannot be edited. The second figure shows the fields expanded. The fields are expanded and collapsed by clicking on the arrow in the fields title bar.