Sign in Join
FPDoc Onlineexperiment

TDBGridColumns class

In unit DBGrids

Implements a collection for columns in a database-aware grid.

Declaration

pascal
TDBGridColumns = class(TGridColumns)

Inheritance

  1. TDBGridColumns
  2. TGridColumns
  3. TCollection
  4. TPersistent
  5. 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.

See also

Properties

ItemspublicItems provides indexed access to columns added to the collection.

Methods

UpdateprotectedRedraws the Grid control that owns the column collection.
ColumnFromFieldprotectedColumnFromField returns the collection item for the specified Field.
HasAutomaticColumnsprotectedHasAutomaticColumns indicates if any items in the collection are an automatic column.
HasDesignColumnsprotectedHasDesignColumns indicates if the collection contains any items explicitly added at design-time.
RemoveAutoColumnsprotectedRemoveAutoColumns removes automatic columns in the collection.
AddpublicAdd creates and stores a new item in the collection.
ColumnByFieldnamepublicGets the collection item with the specified field name.
ColumnByTitlepublicGets the collection item with the specified column title.
LinkFieldspublicAssociates column items with the corresponding Fields in the Dataset.
ResetColumnsOrderpublicResetColumnsOrder arranges columns in the collection to the specified order.

Inherited

From TGridColumns (17)

Clear Create Enabled ExchangeColumn FontChanged GetOwner Grid HasIndex IndexOf InsertColumn IsDefault MoveColumn RealIndex RemoveColumn TitleFontChanged VisibleCount VisibleIndex

From TCollection (26)

Assign BeginUpdate Changed Count Delete Destroy EndUpdate Exchange FindItemID GetAttr GetAttrCount GetEnumerator GetItem GetItemAttr GetNamePath Insert ItemClass Move Notify Owner PropName SetItem SetItemName SetPropName Sort UpdateCount

From TPersistent (5)

AssignTo DefineProperties FPOAttachObserver FPODetachObserver FPONotifyObservers

From TObject (40)

AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.