[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'DBGrids' (#lcl)

TDBGridColumns

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Implements a collection for columns in a database grid

Declaration

Source position: dbgrids.pas line 303

type TDBGridColumns = class(TGridColumns)

protected

  procedure Update(); override;

  

Redraws the Grid control that owns the collection

  function ColumnFromField();

  

ColumnFromField returns the collection item for the specified Field

  function HasAutomaticColumns;

  

HasAutomaticColumns indicates if any items in the collection are an automatic column

  function HasDesignColumns;

  

HasDesignColumns indicates if the collection contains any items explicitly added at design-time

  procedure RemoveAutoColumns;

  

RemoveAutoColumns removes automatic columns in the collection

public

  function Add;

  

Add creates and stores a new item in the collection

  procedure LinkFields;

  

Associates column items with the corresponding Fields in the Dataset

  procedure ResetColumnsOrder();

  

ResetColumnsOrder arranges columns in the collection to the specified order

  property Items []: TColumn; default; [rw]

  

Items provides indexed access to columns added to the collection

end;

Inheritance

TDBGridColumns

  

Implements a collection for columns in a database grid

|

TGridColumns

  

TGridColumns - the group of columns in the grid

|

TCollection

?

TObject

Description

TDBGridColumns is a TGridColumns descendant which implements a collection for columns added to TDBGrid.

TDBGridColumns extends the ancestor class to include support for adding and removing automatic columns at run-time. Automatic columns are a feature in TDBGrid that, when enabled, ensures the collection has a column definition for each Field in the linked dataset for its grid control. Methods and Properties are provided to identify columns added at run-time, and to order entries in the collection by their design-time or run-time indices.

Items is the default property for the collection. TColumn is the class type used for Items added to the collection.

Use the Add method to create a new collection item in the Items property. Use LinkFields to update the association between an item in the collection and the TField used to access its data. Use ResetColumnsOrder to change the order of Items in the collection.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.