TDBGridColumns class
Implements a collection for columns in a database-aware grid.
Declaration
TDBGridColumns = class(TGridColumns)Inheritance
- TDBGridColumns
- TGridColumns
- TCollection
- TPersistent
- 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
Items | public | Items provides indexed access to columns added to the collection. |
Methods
Update | protected | Redraws the Grid control that owns the column collection. |
ColumnFromField | protected | ColumnFromField returns the collection item for the specified Field. |
HasAutomaticColumns | protected | HasAutomaticColumns indicates if any items in the collection are an automatic column. |
HasDesignColumns | protected | HasDesignColumns indicates if the collection contains any items explicitly added at design-time. |
RemoveAutoColumns | protected | RemoveAutoColumns removes automatic columns in the collection. |
Add | public | Add creates and stores a new item in the collection. |
ColumnByFieldname | public | Gets the collection item with the specified field name. |
ColumnByTitle | public | Gets the collection item with the specified column title. |
LinkFields | public | Associates column items with the corresponding Fields in the Dataset. |
ResetColumnsOrder | public | ResetColumnsOrder 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.
