Copyright: Copyright © 1998-2007 Developer Express Inc. ALL RIGHTS RESERVED


cxDBVGrid Unit Overview
cxDBVGrid Unit

Classes

TcxDBEditorPropertiesCollection

TcxDBEditorRow

TcxDBEditorRowItemProperties

TcxDBEditorRowProperties

TcxDBMultiEditorRow

TcxDBMultiEditorRowProperties

TcxDBVerticalGrid

TcxDBVerticalGridDataController

TcxDBVerticalGridItemDataBinding


TcxDBEditorPropertiesCollection
TcxDBEditorPropertiesCollection Object

Hierarchy          Properties          Methods

Represents a collection of the multi editor row data-aware items.

Unit

cxDBVGrid

TcxDBEditorPropertiesCollection = class(TcxEditorPropertiesCollection)

Description

An item in the context of the data-aware grid control represents a dataset field.

The TcxDBEditorRowItemProperties class represents a data-aware item that used in the multi editor row.

The TcxDBEditorPropertiesCollection class represents a collection of the data-aware items used in the particular multi editor row.


TcxDBEditorPropertiesCollection Hierarchy
Hierarchy

TCollection

     |

TcxEditorPropertiesCollection

     |


Properties for TcxDBEditorPropertiesCollection
TcxDBEditorPropertiesCollection Properties

TcxDBEditorPropertiesCollection          Legend

In TcxDBEditorPropertiesCollection

Items

Derived from TcxEditorPropertiesCollection

Items

Row


Methods for TcxDBEditorPropertiesCollection
TcxDBEditorPropertiesCollection Methods

TcxDBEditorPropertiesCollection          Legend

In TcxDBEditorPropertiesCollection

 Add

Derived from TcxEditorPropertiesCollection

 Add


TcxDBEditorPropertiesCollection.Items

TcxDBEditorPropertiesCollection

Provides indexed access to the data-aware items.

property Items[Index:Integer]: TcxDBEditorRowItemProperties;

Description

Used to get indexed access to the specified data-aware item.

The Index parameter specifies the data-aware item.

ReadOnly Property


TcxDBEditorPropertiesCollection.Add

TcxDBEditorPropertiesCollection

Creates a new data-aware item and adds it to the end of the TcxDBEditorPropertiesCollection collection.

function Add: TcxDBEditorRowItemProperties;

Description

The Add method creates a new data-aware item and adds it to the end of the collection. The Add method returns the new TcxDBEditorRowItemProperties item. The following code snippet demonstrates how you can do that:

//Delphi

//...

// Create the MPG City item, define type for data item and assign appropriate editor

with MultiEditorRow1.Properties.Editors.Add do

    begin

        DataBinding.ValueTypeClass := TcxIntegerValueType;

        EditPropertiesClass := TcxSpinEditProperties;

        Value := 16;

  	  Caption := 'MPG City';

    end;

//...

// Create the MPG Highway item, define type for data item and assign appropriate editor

with MultiEditorRow1.Properties.Editors.Add do

    begin

        DataBinding.ValueTypeClass := TcxIntegerValueType;

        EditPropertiesClass := TcxSpinEditProperties;

        Value := 23;

  Caption := 'MPG Highway';

    end;

When running this code the output will be:


TcxDBEditorRow
TcxDBEditorRow Object

Hierarchy          Properties          Methods

Represents the data-aware editor row in the grid control.

Unit

cxDBVGrid

TcxDBEditorRow = class(TcxCustomEditorRow)

Description

The TcxDBEditorRow is used to represent a data-aware row with one data-aware item. An item in the context of the data-aware grid control represents a dataset field. When formatted the row has one cell in header column or data column. The data cell corresponds to the dataset field represented by the TcxDBVerticalGridItemDataBinding.FieldName property. This type of row supports editing capabilities. The type of editor bound to the row specifies the kind of editing. To bind an editor to the row use either the TcxCustomEditorRowProperties.EditProperties or TcxCustomEditorRowProperties.RepositoryItem properties.

Properties, TcxCustomRow.Options and TcxCustomEditorRow.Styles properties are used to customize behavior and appearance of the row.

The following image demonstrates the data-aware editor row:


TcxDBEditorRow Hierarchy
Hierarchy

TComponent

     |

TcxCustomRow

     |

TcxCustomEditorRow

     |


Properties for TcxDBEditorRow
TcxDBEditorRow Properties

TcxDBEditorRow          Legend

Derived from TcxCustomEditorRow

Properties

Styles

Derived from TcxCustomRow

AbsoluteIndex

Count

Expanded

Height

Index

Level

Options

OwnerRows

Parent

Rows

Styles

VerticalGrid

ViewInfo

Visible

VisibleIndex


Methods for TcxDBEditorRow
TcxDBEditorRow Methods

TcxDBEditorRow          Legend

Derived from TcxCustomEditorRow

 CreateHeaderInfo

 CreateViewInfo

Derived from TcxCustomRow

 Assign

 Changed

 Collapse

 Expand

 GetFirstVisibleChild

 GetLastVisibleChild

 HasChildren

 HasVisibleChildren

 IndexOf

 IsChild

 IsFirst

 IsFirstVisible

 IsLast

 IsLastVisible

 IsParent

 IsRootLevel

 MakeVisible

 RestoreDefaults


TcxDBEditorRow.Properties

TcxDBEditorRow

Represents settings that control the data-aware editor row behavior.

property Properties: TcxDBEditorRowProperties;

Description

Used to get access to the TcxDBEditorRowProperties object that provides settings to control the data-aware editor row behavior.

The following TcxDBEditorRowProperties published properties control row behavior:

•	DataBinding used to bind dataset field to the row;

•	EditProperties specifies the properties of an editor used for editing the row contents;

•	Options used to customize editing behavior;

•	RepositoryItem specifies the repository item for the row.


TcxDBEditorRowItemProperties
TcxDBEditorRowItemProperties Object

Hierarchy          Properties          Methods          Events

Contains settings that define behavior of a data-aware item in the multi editor row.

Unit

cxDBVGrid

TcxDBEditorRowItemProperties = class(TcxCollectionItemEditorRowProperties)

Description

An item in the context of the data-aware grid control represents a dataset field. When formatted one item occupies one cell per column in a row (one cell for the item name in a header column and one cell for the item value in a data column).

The multi editor row (see TcxCustomMultiEditorRow) can hold any number of items. Respectively the number of cells in a column in the multi editor row depends on the number of items it holds.

The TcxDBEditorRowItemProperties class is used to work with the data-aware items in the multi editor row. The TcxDBEditorRowItemProperties class defines settings for these items.


TcxDBEditorRowItemProperties Hierarchy
Hierarchy

TcxInterfacedCollectionItem

     |

TcxCustomRowProperties

     |

TcxCaptionRowProperties

     |

TcxCustomEditorRowProperties

     |

TcxCollectionItemEditorRowProperties

     |


Properties for TcxDBEditorRowItemProperties
TcxDBEditorRowItemProperties Properties

TcxDBEditorRowItemProperties          Legend

In TcxDBEditorRowItemProperties

DataBinding

Derived from TcxCollectionItemEditorRowProperties

Width

Derived from TcxCustomEditorRowProperties

EditProperties

EditPropertiesClass

Options

RepositoryItem

Value

Values

Derived from TcxCaptionRowProperties

Caption

HeaderAlignmentHorz

HeaderAlignmentVert

Hint

ImageIndex

Derived from TcxCustomRowProperties

Row


Methods for TcxDBEditorRowItemProperties
TcxDBEditorRowItemProperties Methods

TcxDBEditorRowItemProperties          Legend

Derived from TcxCollectionItemEditorRowProperties

 CreateEx

Derived from TcxCustomEditorRowProperties

 Assign

 CreateEx

Derived from TcxCaptionRowProperties

 CreateEx

 DefaultCaption

 RestoreDefaults

Derived from TcxCustomRowProperties

 CreateEx


Events for TcxDBEditorRowItemProperties
TcxDBEditorRowItemProperties Events

TcxDBEditorRowItemProperties          Legend

Derived from TcxCustomEditorRowProperties

 OnGetDisplayText

 OnGetEditingProperties

 OnGetEditProperties


TcxDBEditorRowItemProperties.DataBinding

TcxDBEditorRowItemProperties

Represents an object associating a data-aware item with a dataset field.

property DataBinding: TcxDBVerticalGridItemDataBinding;

Description

The DataBinding represents an object associating a data-aware item with a dataset field.

Each data-aware item corresponds to the dataset field specified by the FieldName property.


TcxDBEditorRowProperties
TcxDBEditorRowProperties Object

Hierarchy          Properties          Methods          Events

Represents settings that define the data-aware editor row behavior.

Unit

cxDBVGrid

TcxDBEditorRowProperties = class(TcxCustomEditorRowProperties)

Description

The TcxDBEditorRowProperties provides settings used to control the data-aware editor row behavior. The TcxDBEditorRowProperties class inherits settings from the TcxCaptionRowProperties class: TcxCaptionRowProperties.Caption, TcxCaptionRowProperties.HeaderAlignmentHorz, TcxCaptionRowProperties.HeaderAlignmentVert, TcxCaptionRowProperties.Hint, TcxCaptionRowProperties.ImageIndex. These settings control the data-aware editor row header behavior. The DataBinding property enables the row to bind the specified dataset field. The EditProperties property is used to assign the appropriate data item editor to the row. As an alternative you can use the RepositoryItem property to bind the desired data item editor settings. And finally the Options property controls user actions on the row.

The following image demonstrates these settings in the Object Inspector:


TcxDBEditorRowProperties Hierarchy
Hierarchy

TcxInterfacedCollectionItem

     |

TcxCustomRowProperties

     |

TcxCaptionRowProperties

     |

TcxCustomEditorRowProperties

     |


Properties for TcxDBEditorRowProperties
TcxDBEditorRowProperties Properties

TcxDBEditorRowProperties          Legend

In TcxDBEditorRowProperties

DataBinding

Derived from TcxCustomEditorRowProperties

EditProperties

EditPropertiesClass

Options

RepositoryItem

Value

Values

Derived from TcxCaptionRowProperties

Caption

HeaderAlignmentHorz

HeaderAlignmentVert

Hint

ImageIndex

Derived from TcxCustomRowProperties

Row


Methods for TcxDBEditorRowProperties
TcxDBEditorRowProperties Methods

TcxDBEditorRowProperties          Legend

Derived from TcxCustomEditorRowProperties

 Assign

 CreateEx

Derived from TcxCaptionRowProperties

 CreateEx

 DefaultCaption

 RestoreDefaults

Derived from TcxCustomRowProperties

 CreateEx


Events for TcxDBEditorRowProperties
TcxDBEditorRowProperties Events

TcxDBEditorRowProperties          Legend

Derived from TcxCustomEditorRowProperties

 OnGetDisplayText

 OnGetEditingProperties

 OnGetEditProperties


TcxDBEditorRowProperties.DataBinding

TcxDBEditorRowProperties

Represents an object associating a data-aware row with a dataset field.

property DataBinding: TcxDBVerticalGridItemDataBinding;

Description

The DataBinding property represents an object associating a data-aware row with a dataset field.

Each data-aware row corresponds to the dataset field specified by the FieldName property.


TcxDBMultiEditorRow
TcxDBMultiEditorRow Object

Hierarchy          Properties          Methods

Represents the data-aware multi editor row in the grid control.

Unit

cxDBVGrid

TcxDBMultiEditorRow = class(TcxCustomMultiEditorRow)

Description

The TcxDBMultiEditorRow represents the data-aware multi editor row containing a set of data-aware items. An item in the context of the data-aware grid control represents a dataset field. When formatted one item occupies one cell per column in a row (one cell for the item name in a header column and one cell for the item value in a data column). The data cell corresponds to the dataset field represented by the TcxDBVerticalGridItemDataBinding.FieldName property. The TcxMultiEditorRowProperties.Editors property is used to bind the particular item to the multi editor row. The TcxDBMultiEditorRow row supports editing capabilities. The type of editor bound to the item specifies the kind of editing. To bind an editor to the item use either the TcxCustomEditorRowProperties.EditProperties or TcxCustomEditorRowProperties.RepositoryItem properties. TcxCustomMultiEditorRow.Properties and TcxCustomMultiEditorRow.Styles properties are used to customize behavior and appearance of the row.

The following image demonstrates the data-aware multi editor row:


TcxDBMultiEditorRow Hierarchy
Hierarchy

TComponent

     |

TcxCustomRow

     |

TcxCustomMultiEditorRow

     |


Properties for TcxDBMultiEditorRow
TcxDBMultiEditorRow Properties

TcxDBMultiEditorRow          Legend

Derived from TcxCustomMultiEditorRow

Properties

Styles

Derived from TcxCustomRow

AbsoluteIndex

Count

Expanded

Height

Index

Level

Options

OwnerRows

Parent

Rows

Styles

VerticalGrid

ViewInfo

Visible

VisibleIndex


Methods for TcxDBMultiEditorRow
TcxDBMultiEditorRow Methods

TcxDBMultiEditorRow          Legend

Derived from TcxCustomMultiEditorRow

 CreateHeaderInfo

 CreateViewInfo

Derived from TcxCustomRow

 Assign

 Changed

 Collapse

 Expand

 GetFirstVisibleChild

 GetLastVisibleChild

 HasChildren

 HasVisibleChildren

 IndexOf

 IsChild

 IsFirst

 IsFirstVisible

 IsLast

 IsLastVisible

 IsParent

 IsRootLevel

 MakeVisible

 RestoreDefaults


TcxDBMultiEditorRow.Properties

TcxDBMultiEditorRow

Represents settings to control the data-aware multi editor row behavior.

property Properties: TcxDBMultiEditorRowProperties;

Description

Used to get access to the TcxDBMultiEditorRowProperties object. The TcxDBMultiEditorRowProperties class encapsulates settings that control the data-aware multi editor row behavior.

The Editors property published in the TcxDBMultiEditorRowProperties is used to add data-aware items to the multi editor row.


TcxDBMultiEditorRowProperties
TcxDBMultiEditorRowProperties Object

Hierarchy          Properties          Methods

Represents settings that control the data-aware multi editor row behavior.

Unit

cxDBVGrid

TcxDBMultiEditorRowProperties = class(TcxMultiEditorRowProperties)

Description

The TcxDBMultiEditorRowProperties class provides settings used to control the data-aware multi editor row behavior. The Editors property enables the data-aware multi editor row to bind the desired data-aware items represented by the TcxDBEditorRowItemProperties. The following settings are used to control the data-aware items appearance: Fixed, SeparatorAlignmentVert, SeparatorKind, SeparatorString. And the Row property can be used to access the row that encapsulates these settings.

The following image demonstrates the data-aware multi editor row settings in the Object Inspector:


TcxDBMultiEditorRowProperties Hierarchy
Hierarchy

TcxInterfacedCollectionItem

     |

TcxCustomRowProperties

     |

TcxMultiEditorRowProperties

     |


Properties for TcxDBMultiEditorRowProperties
TcxDBMultiEditorRowProperties Properties

TcxDBMultiEditorRowProperties          Legend

In TcxDBMultiEditorRowProperties

Editors

Derived from TcxMultiEditorRowProperties

Fixed

SeparatorAlignmentVert

SeparatorKind

SeparatorString

Derived from TcxCustomRowProperties

Row


Methods for TcxDBMultiEditorRowProperties
TcxDBMultiEditorRowProperties Methods

TcxDBMultiEditorRowProperties          Legend

Derived from TcxMultiEditorRowProperties

Assign

CreateEx

Derived from TcxCustomRowProperties

 	Changed

 CreateEx


TcxDBMultiEditorRowProperties.Editors

TcxDBMultiEditorRowProperties

Represents a collection of the data-aware items of the multi editor row.

property Editors: TcxDBEditorPropertiesCollection;

Description

Used to assign data-aware items to the current multi editor row or to get indexed access to the specified data-aware item.

The TcxDBEditorRowItemProperties class represents a data-aware item. It defines settings for the item used in the multi editor row.


TcxDBVerticalGrid
TcxDBVerticalGrid Object

Hierarchy          Properties          Methods          Events

Represents the data-aware vertical grid control.

Unit

cxDBVGrid

TcxDBVerticalGrid = class(TcxVirtualVerticalGrid)

Description

The vertical grid control is capable to display dataset records in the grid data columns vertically.

The TcxDBVerticalGrid class enables to work with dataset records retrieved using its DataController property in 3 possible layouts:

•	Single record layout - only one record available at a time in the grid control;

•	Multiple record layout - more than one record available at a time in the grid control;

•	Bands view layout - only one record available at a time in the grid control. The record will be rearranged to occupy all the grid control client area if the height of the grid control is insufficient to display the record height entirely.

The grid control’s layout is defined by the TcxVirtualVerticalGrid.LayoutStyle property.


TcxDBVerticalGrid Hierarchy
Hierarchy

TcxExtEditingControl

     |

TcxCustomVerticalGrid

     |

TcxVirtualVerticalGrid

     |


Properties for TcxDBVerticalGrid
TcxDBVerticalGrid Properties

TcxDBVerticalGrid          Legend

In TcxDBVerticalGrid

DataController

Derived from TcxVirtualVerticalGrid

LayoutStyle

OptionsBehavior

OptionsData

Derived from TcxCustomVerticalGrid

Customizing

FocusedRow

HitTest

Images

OptionsBehavior

OptionsData

OptionsView

Rows

StoringName

Styles

TopVisibleRowIndex

ViewInfo


Methods for TcxDBVerticalGrid
TcxDBVerticalGrid Methods

TcxDBVerticalGrid          Legend

Derived from TcxCustomVerticalGrid

 Add

 AddChild

 AssignRows

 CancelEdit

 ClearRows

 FirstRow

 FirstVisibleRow

 FullCollapse

 FullExpand

 HasRows

 HasVisibleRows

 HideEdit

 IsInternalDragging

 IsRowVisible

 LastRow

 LastVisibleRow

 NextRow

 NextVisibleRow

 PrevRow

 PrevVisibleRow

 Remove

 RestoreDefaults

 RestoreFromIniFile

 RestoreFromRegistry

 RestoreFromStream

 RowByCaption

 RowByName

 ShowEdit

 ShowEditByKey

 ShowEditByMouse

 StoreToIniFile

 StoreToRegistry

 StoreToStream


Events for TcxDBVerticalGrid
TcxDBVerticalGrid Events

TcxDBVerticalGrid          Legend

Derived from TcxVirtualVerticalGrid

 OnFilterControlDialogShow

 OnFilterRecord

 OnFocusedRecordChanged

Derived from TcxCustomVerticalGrid

 OnDrawRowHeader

 OnDrawValue

 OnItemChanged

 OnLeftVisibleBandIndexChanged

 OnLeftVisibleRecordIndexChanged

 OnTopRowIndexChanged


TcxDBVerticalGrid.DataController

TcxDBVerticalGrid

Represents a data controller that unifies access to a data source.

property DataController: TcxDBVerticalGridDataController;

Description

It used to access the TcxDBVerticalGridDataController object. The TcxDBVerticalGridDataController class is a wrapper class for a data source (see TcxDBVerticalGridDataController.DataSource). It handles a data from a dataset via a data source object.


TcxDBVerticalGridDataController
TcxDBVerticalGridDataController Object

Hierarchy          Properties          Methods

Represents a data controller that handles a data from a dataset via a data source object.

Unit

cxDBVGrid

TcxDBVerticalGridDataController = class(TcxDBDataController)

Description

This object provides a unified interface and implements reusable operations so it eases the task for the developer to work with a dataset. This class was designed to automatically map the grid rows to the dataset fields and update the data in the grid control. The TcxDBVerticalGridDataController also supports a feature named Grid Mode that enables the data controller to cache data in limited amounts of records as specified by the GridModeBufferCount property. For details please refer to the GridMode property.


TcxDBVerticalGridDataController Hierarchy
Hierarchy

TcxDBDataController

     |


Properties for TcxDBVerticalGridDataController
TcxDBVerticalGridDataController Properties

TcxDBVerticalGridDataController          Legend

In TcxDBVerticalGridDataController

GridMode

GridModeBufferCount

Derived from TcxDBDataController

DataModeController

DataSource

DetailKeyFieldNames

Filter

KeyFieldNames

MasterKeyFieldNames

Derived from TcxCustomDataController

CustomDataSource

DisplayTexts

EditOperations

EditState

Filter

FilteredIndexByRecordIndex

FilteredRecordCount

FilteredRecordIndex

FocusedRecordIndex

FocusedRowIndex

Groups

IsEditing

IsPattern

MultiSelect

Options

RecordCount

RowCount

Search

Summary

Values


Methods for TcxDBVerticalGridDataController
TcxDBVerticalGridDataController Methods

TcxDBVerticalGridDataController          Legend

In TcxDBVerticalGridDataController

 CreateAllItems

Derived from TcxDBDataController

 BeginLocate

 ChangeFieldName

 EndLocate

 GetItemByFieldName

 GetItemField

 GetItemFieldName

 GetRecordId

 LocateByKey

 GetSelectedBookmark

Derived from TcxCustomDataController

 Append

 AppendRecord

 BeginFullUpdate

 BeginUpdate

 BeginUpdateFields

 Cancel

 ChangeDetailExpanding

 ChangeRowSelection

 CheckFocusedSelected

 ClearBookmark

 ClearDetailLinkObject

 ClearDetails

 ClearSelection

 ClearSorting

 CollapseDetails

 DeleteFocused

 DeleteRecord

 DeleteSelection

 Edit

 EndFullUpdate

 EndUpdate

 FindRecordIndexByText

 ForEachRow

 FocusDetails

 GetDetailDataController

 GetMasterDataController

 GetMasterRecordIndex

 GetPatternDataController

 GetRowDisplayText

 GetRowIndexByRecordIndex

 GetRowInfo

 GetRowValue

 GetSelectedCount

 GetSelectedRowIndex

 GotoBookmark

 GotoFirst

 GotoLast

 GotoNext

 GotoPrev

 Insert

 InsertRecord

 IsBOF

 IsBookmarkAvailable

 IsDetailMode

 IsEOF

 IsGridMode

 IsRowSelected

 LoadFromStream

 MakeRecordVisible

 Post

 RefreshExternalData

 SaveBookmark

 SaveToStream

 SelectAll

 SelectRows

 SetEditValue

 SetValue

 SyncSelected


Events for TcxDBVerticalGridDataController
TcxDBVerticalGridDataController Events

TcxDBVerticalGridDataController          Legend

Derived from TcxDBDataController

 OnDetailHasChildren

Derived from TcxCustomDataController

 OnAfterCancel

 OnAfterDelete

 OnAfterInsert

 OnAfterPost

 OnBeforeCancel

 OnBeforeDelete

 OnBeforeInsert

 OnBeforePost

 OnCompare

 OnDataChanged

 OnDetailCollapsed

 OnDetailCollapsing

 OnDetailExpanded

 OnDetailExpanding

 OnFilterRecord

 OnGroupingChanged

 OnRecordChanged

 OnNewRecord

 OnSortingChanged


TcxDBVerticalGridDataController.GridMode

TcxDBVerticalGridDataController          See Also

Specifies whether the data controller supports the Grid Mode.

property GridMode: Boolean;

Description

Specifies whether the data controller supports the Grid Mode. The Grid Mode was designed to resolve data controller performance issues when connected to a large dataset. When working in this mode the data controller populates itself with a limited number of records from the dataset as specified by the GridModeBufferCount property. As a consequence the grid control only loads these records from the data controller. As the user browses records in the grid control the data controller loads the next chunk of data to be displayed and so on.

Note: if the value of the GridModeBufferCount property is less than the number of records that the grid control can display in its client area, the grid control will initially only display the number of records specified by the GridModeBufferCount property.

When the GridMode’s property value is True the data controller works in Grid Mode. If the GridMode’s property value is False the data controller loads all records stored in the dataset at once.

The default value of the GridMode property is False.


TcxDBVerticalGridDataController.GridModeBufferCount

TcxDBVerticalGridDataController          See Also

Specifies the number of records that should be loaded into the data controller from the dataset.

property GridModeBufferCount: Integer;

Description

This property is in effect if the GridMode’s property value is True. Otherwise the data controller loads all the records stored in the dataset.

When the value of the GridModeBufferCount property is 0 the grid control is responsible for deciding how many records will be loaded.

The default value of the GridModeBufferCount property is 0.


TcxDBVerticalGridDataController.CreateAllItems

TcxDBVerticalGridDataController

Creates rows for all dataset fields.

procedure CreateAllItems;

Description

When the TcxDBVerticalGrid control is bound to a data source initially it displays no data. The CreateAllItems method creates rows in the grid control for dataset fields and automatically links them to the corresponding fields via the TcxDBEditorRowProperties.DataBinding property. The name of the dataset field represented by the current row is assigned to the TcxDBVerticalGridItemDataBinding.FieldName property. The each row’s caption and visibility are determined respectively by the TField.DisplayLabel property’s and TField.Visible property’s values of the corresponding dataset field.


TcxDBVerticalGridItemDataBinding
TcxDBVerticalGridItemDataBinding Object

Hierarchy          Properties

Represents a data-binding component.

Unit

cxDBVGrid

TcxDBVerticalGridItemDataBinding = class(TcxCustomItemDataBinding)

Description

Used to bind a data-aware item with a dataset field via the TcxDBVerticalGridDataController object.


TcxDBVerticalGridItemDataBinding Hierarchy
Hierarchy

TcxCustomItemDataBinding

     |


Properties for TcxDBVerticalGridItemDataBinding
TcxDBVerticalGridItemDataBinding Properties

TcxDBVerticalGridItemDataBinding          Legend

In TcxDBVerticalGridItemDataBinding

DataController

Field

FieldName


TcxDBVerticalGridItemDataBinding.DataController

TcxDBVerticalGridItemDataBinding

Represents a data controller that unifies access to a data source.

property DataController: TcxDBVerticalGridDataController;

Description

Used to get access to the TcxDBVerticalGridDataController object that manages the work with a dataset.

ReadOnly Property


TcxDBVerticalGridItemDataBinding.Field

TcxDBVerticalGridItemDataBinding

Represents a dataset field.

property Field: TField;

Description

Used to get a reference to the dataset field.

ReadOnly Property


TcxDBVerticalGridItemDataBinding.FieldName

TcxDBVerticalGridItemDataBinding

Represents a dataset field name.

property FieldName: string;

Description

Indicates a dataset field name that can be used to get access to the dataset field.


cxOI Unit Overview
cxOI Unit

Classes

EcxPropertyError

TcxCustomRTTIInspector

TcxPropertyEditor

TcxRTTIInspector

Routines

cxRegisterEditPropertiesClass

cxRegisterPropertyEditor


EcxPropertyError
EcxPropertyError Object

Hierarchy

Represents runtime checked exception for invalid argument of the property editor setter method.

Unit

cxOI

EcxPropertyError = class(Exception)

Description

The EcxPropertyError defines the type of exception that is thrown to indicate that the property editor setter method has been passed an illegal or inappropriate argument.


EcxPropertyError Hierarchy
Hierarchy

Exception

     |

EcxPropertyError


TcxCustomRTTIInspector
TcxCustomRTTIInspector Object

Hierarchy          Properties          Methods          Events

Represents the base class for implementing the cxRTTIInspector runtime object inspector control.

Unit

cxOI

TcxCustomRTTIInspector = class(TcxUnboundVerticalGrid)

Description

The runtime object inspector enables the user to edit properties values at runtime for the components placed onto a form including the grid control and its components.

The TcxCustomRTTIInspector class introduces base interface structure and behavior for the runtime object inspector control.


TcxCustomRTTIInspector Hierarchy
Hierarchy

TcxExtEditingControl

     |

TcxCustomVerticalGrid

     |

TcxUnboundVerticalGrid

     |

TcxCustomRTTIInspector


Properties for TcxCustomRTTIInspector
TcxCustomRTTIInspector Properties

TcxCustomRTTIInspector          Legend

In TcxCustomRTTIInspector

InspectedObject

Derived from TcxUnboundVerticalGrid

LayoutStyle

Derived from TcxCustomVerticalGrid

Customizing

FocusedRow

HitTest

Images

OptionsBehavior

OptionsData

OptionsView

Rows

StoringName

Styles

TopVisibleRowIndex

ViewInfoIDH_TcxCustomVerticalGrid_ViewInfo>Main


Methods for TcxCustomRTTIInspector
TcxCustomRTTIInspector Methods

TcxCustomRTTIInspector          Legend

In TcxCustomRTTIInspector

 RefreshInspectedProperties

Derived from TcxCustomVerticalGrid

 Add

 AddChild

 AssignRows

 CancelEdit

 ClearRows

 FirstRow

 FirstVisibleRow

 FullCollapse

 FullExpand

 HasRows

 HasVisibleRows

 HideEdit

 IsInternalDragging

 IsRowVisible

 LastRow

 LastVisibleRow

 NextRow

 NextVisibleRow

 PrevRow

 PrevVisibleRow

 Remove

 RestoreDefaults

 RestoreFromIniFile

 RestoreFromRegistry

 RestoreFromStream

 RowByCaption

 RowByName

 ShowEdit

 ShowEditByKey

 ShowEditByMouse

 StoreToIniFile

 StoreToRegistry

 StoreToStream


Events for TcxCustomRTTIInspector
TcxCustomRTTIInspector Events

TcxCustomRTTIInspector          Legend

In TcxCustomRTTIInspector

 OnFilterProperty

 OnPropertyChanged

Derived from TcxCustomVerticalGrid

 OnDrawRowHeader

 OnDrawValue

 OnItemChanged

 OnLeftVisibleBandIndexChanged

 OnLeftVisibleRecordIndexChanged

 OnTopRowIndexChanged


TcxCustomRTTIInspector.InspectedObject

TcxCustomRTTIInspector

Represents the inspected component that the runtime object inspector is bound to.

property InspectedObject: TPersistent;

Description

The InspectedObject property represents the inspected component that the runtime object inspector is bound to. The published properties of this component appear in the runtime object inspector and the user can edit their values.


TcxCustomRTTIInspector.RefreshInspectedProperties

TcxCustomRTTIInspector

Updates the runtime object inspector with updated properties if the values of these properties were changed outside the runtime object inspector.

procedure RefreshInspectedProperties;

Description

Updates the runtime object inspector with updated properties if the values of these properties were changed outside the runtime object inspector.


TcxCustomRTTIInspector.OnFilterProperty

TcxCustomRTTIInspector

Occurs when the runtime object inspector is being populated with the inspected component’s properties.

type

  TcxFilterPropertyEvent = procedure(Sender: TObject; const PropertyName: string; var Accept: Boolean) of object;

property OnFilterProperty: TcxFilterPropertyEvent;

Description

Use this event if you need to filter a set of properties for editing in the runtime object inspector.

The Sender is the TcxCustomRTTIInspector descendant instance. The PropertyName is the name of the current property of the inspected object. The Accept indicates whether the PropertyName property will be inspected. If the value of the Accept property is False the PropertyName property won’t be inspected.


TcxCustomRTTIInspector.OnPropertyChanged

TcxCustomRTTIInspector

Occurs when the value of the edited property was changed and editing is finished.

type

  TNotifyEvent = procedure(Sender: TObject) of object;

property OnPropertyChanged: TNotifyEvent;

Description

Use this event if you need to take a specific action when the edited property was changed and editing is finished. Editing is finished means the Enter key is pressed after the value of the property has been changed or the changed property loses focus.

The Sender is the TcxCustomRTTIInspector descendant instance.


TcxPropertyEditor
TcxPropertyEditor Object

Hierarchy          Properties          Methods

The TcxPropertyEditor is the base class for editors used to edit the inspected components’ properties in the runtime object inspector.

Unit

cxOI

TcxPropertyEditor = class(TObject)

Description

The TcxPropertyEditor is the base class for editors used to edit the inspected components’ properties in the runtime object inspector. This class implements common behavior for its descendants. Do not use this class directly. Use descendants instead. Every descendant is implemented based on the type of a property it is used for.

These are descendants of the TcxPropertyEditor class: TcxOrdinalProperty, TcxFloatProperty, TcxInt64Property, TcxStringProperty, TcxSetElementProperty, TcxClassProperty, TcxComponentProperty, TcxDateProperty, TcxTimeProperty, TcxDateTimeProperty, TcxVariantProperty, TcxVariantTypeProperty.


TcxPropertyEditor Hierarchy
Hierarchy

TObject

     |

TcxPropertyEditor


Properties for TcxPropertyEditor
TcxPropertyEditor Properties

TcxPropertyEditor          Legend

In TcxPropertyEditor

Inspector

PropCount

Value


Methods for TcxPropertyEditor
TcxPropertyEditor Methods

TcxPropertyEditor          Legend

In TcxPropertyEditor

 AllEqual

 Edit

 GetAttributes

 GetComponent

 GetEditLimit

 GetName

 GetProperties

 GetPropType

 GetValue

 GetValues

 IsDefaultValue

 SetValue

 ValueAvailable


TcxPropertyEditor.Inspector

TcxPropertyEditor

Represents the runtime object inspector.

property Inspector: TcxCustomRTTIInspector;

Description

Use this property to get access to the runtime object inspector.

ReadOnly Property


TcxPropertyEditor.PropCount

TcxPropertyEditor

Represents the number of inspected components properties of the same type associated with the current editor.

property PropCount: Integer;

Description

Represents the number of inspected components properties of the same type associated with the current editor.

ReadOnly Property


TcxPropertyEditor.Value

TcxPropertyEditor

Provides the string representation of the current property value.

property Value: string;

Description

Determines and specifies the current property value as a string. The string type unifies representation of edited properties of different types in the runtime object inspector.


TcxPropertyEditor.AllEqual

TcxPropertyEditor

Tests whether only one inspected component with the edited property is selected.

function AllEqual: Boolean; virtual;

Description

This method returns True if only one inspected component with the edited property is selected.


TcxPropertyEditor.Edit

TcxPropertyEditor

Sets the edited property to some default value.

procedure Edit; virtual;

Description

Sets the edited property to some default value. The overridden Edit method in descendants does the steps based on the edited property type. In most cases it:

•	invokes the edit dialog box ;

•	assigns a new value to the edited property after the user has finished the editing.

The Edit method can be invoked under following conditions:

•	the user clicks the ellipsis button to the right of the edited property or

•	the user double clicks the edited property.


TcxPropertyEditor.GetAttributes

TcxPropertyEditor

Returns a set or subset of the TcxPropertyAttributes flags.

function GetAttributes: TcxPropertyAttributes; virtual;

Description

Used to determine what editing behavior to apply to the edited property. Descendants override the GetAttributes method to provide their own settings returned from the GetAttributes method to customize editing behavior.


TcxPropertyEditor.GetComponent

TcxPropertyEditor

Returns the inspected component identified by the Index parameter.

function GetComponent(Index: Integer): TPersistent;

Description

Returns the inspected component identified by the zero-based Index parameter in the collection of components with the shared edited property.


TcxPropertyEditor.GetEditLimit

TcxPropertyEditor

Returns the maximum number of characters for the edited property value.

function GetEditLimit: Integer; virtual;

Description

Returns the maximum length of the property value for text input. The property value is represented as a string in the runtime object inspector. The maximum length of the edited property value is 255 characters. Descendants override this method based on the maximum length available for the type of the edited property.


TcxPropertyEditor.GetName

TcxPropertyEditor

Returns the name of the edited property.

function GetName: string; virtual;

Description

Returns the name of the edited property that is stored in the TTypeInfo record. Some descendants override this method based on the type of the edited property they bound to.


TcxPropertyEditor.GetProperties

TcxPropertyEditor

Provides the subproperties of the edited property to the Proc callback method.

procedure GetProperties(AOwner: TComponent; Proc: TcxGetPropEditProc); virtual;

Description

If the edited property has subproperties the GetProperties method provides these subproperties to the Proc method. The GetProperties method is called when the runtime object inspector creates rows for the edited properties. The runtime object inspector invokes this method if the appropriate GetAttributes method of the current property editor returns ipaSubProperties flag. The GetProperties method has empty implementation. Descendants override the GetProperties method in that way they create appropriate editors for the subproperties and pass them to the Proc method.

The AOwner parameter is the form where controls placed in.

The Proc parameter is a pointer to the callback method.


TcxPropertyEditor.GetPropType

TcxPropertyEditor

Returns a pointer to the type information record for the edited property.

function GetPropType: PTypeInfo;

Description

Returns a pointer to the TTypeInfo record that provides information about the type of the edited property.


TcxPropertyEditor.GetValue

TcxPropertyEditor

Returns the string representation of the edited property value.

function GetValue: string; virtual;

Description

Implements the Value property. Descendants override this method in that way they convert the value of the edited property into string.


TcxPropertyEditor.GetValues

TcxPropertyEditor

Provides enumerated values to the callback method.

procedure GetValues(Proc: TGetStrProc); virtual;

Description

This method has empty implementation. Descendants that provide enumerated values override the GetValues method. The GetValues overridden method invokes the callback method every time the next enumerated value is traversed.

The Proc parameter is the callback method pointer.


TcxPropertyEditor.IsDefaultValue

TcxPropertyEditor

Tests if the edited property value is default value.

function IsDefaultValue: Boolean; virtual;

Description

Returns True if the edited property value is default value. Some descendants override this method based on the type of the edited property they bound to.


TcxPropertyEditor.SetValue

TcxPropertyEditor

Sets the edited property value.

procedure SetValue(const Value: string); virtual;

Description

Implements the Value property. This method has empty implementation. Descendants override this method in that way they convert the value identified by the Value parameter as a string into appropriate type of the edited property value.


TcxPropertyEditor.ValueAvailable

TcxPropertyEditor

Tests whether the edited property value is available for editing or reading.

function ValueAvailable: Boolean;

Description

Returns True if the edited property value is available for editing or reading.


TcxRTTIInspector
TcxRTTIInspector Object

Hierarchy          Properties          Methods          Events

Represents the cxRTTIInspector runtime object inspector control.

Unit

cxOI

TcxRTTIInspector = class(TcxCustomRTTIInspector)

Description

The runtime object inspector is used to set properties of the inspected component at runtime that the runtime object inspector is bound to.

The TcxRTTIInspector introduces no new behavior, just publishes properties inherited from its ancestor the TcxCustomRTTIInspector class.

Use the TcxRTTIInspector to instantiate the runtime object inspector.


TcxRTTIInspector Hierarchy
Hierarchy

TcxExtEditingControl

     |

TcxCustomVerticalGrid

     |

TcxUnboundVerticalGrid

     |

TcxCustomRTTIInspector

     |

TcxRTTIInspector


Properties for TcxRTTIInspector
TcxRTTIInspector Properties

TcxRTTIInspector          Legend

Derived from TcxCustomRTTIInspector

InspectedObject

Derived from TcxUnboundVerticalGrid

LayoutStyle

Derived from TcxCustomVerticalGrid

Customizing

FocusedRow

HitTest

Images

OptionsBehavior

OptionsData

OptionsView

Rows

StoringName

Styles

TopVisibleRowIndex

ViewInfo


Methods for TcxRTTIInspector
TcxRTTIInspector Methods

TcxRTTIInspector          Legend

Derived from TcxCustomRTTIInspector

 RefreshInspectedProperties

Derived from TcxCustomVerticalGrid

 Add

 AddChild

 AssignRows

 CancelEdit

 ClearRows

 FirstRow

 FirstVisibleRow

 FullCollapse

 FullExpand

 HasRows

 HasVisibleRows

 HideEdit

 IsInternalDragging

 IsRowVisible

 LastRow

 LastVisibleRow

 NextRow

 NextVisibleRow

 PrevRow

 PrevVisibleRow

 Remove

 RestoreDefaults

 RestoreFromIniFile

 RestoreFromRegistry

 RestoreFromStream

 RowByCaption

 RowByName

 ShowEdit

 ShowEditByKey

 ShowEditByMouse

 StoreToIniFile

 StoreToRegistry

 StoreToStream


Events for TcxRTTIInspector
TcxRTTIInspector Events

TcxRTTIInspector          Legend

Derived from TcxCustomRTTIInspector

 OnFilterProperty

 OnPropertyChanged

Derived from TcxCustomVerticalGrid

 OnDrawRowHeader

 OnDrawValue

 OnItemChanged

 OnLeftVisibleBandIndexChanged

 OnLeftVisibleRecordIndexChanged

 OnTopRowIndexChanged


cxRegisterEditPropertiesClass
cxRegisterEditPropertiesClass Procedure

Creates the association between an editor and editor properties.

Unit

cxOI

Declaration

procedure cxRegisterEditPropertiesClass(AEditorClass: TcxPropertyEditorClass; AEditPropertiesClass: TcxCustomEditPropertiesClass);

Description

This procedure registers the TcxPropertyEditor custom editor with the TcxCustomEditProperties editor properties class. The TcxCustomEditProperties encapsulates settings that control the specified editor behavior.

The AEditorClass parameter specifies the type of property editor.

The AEditPropertiesClass parameter specifies the type of editor properties.

The following example shows the using of the cxRegisterEditPropertiesClass procedure:

//Delphi

interface

uses cxOI, cxSpinEdit;

//...

initialization

cxRegisterEditPropertiesClass(TcxIntegerProperty, TcxSpinEditProperties);


cxRegisterPropertyEditor
cxRegisterPropertyEditor Procedure

Creates the association between an editor and a property.

Unit

cxOI

Declaration

procedure cxRegisterPropertyEditor(APropertyType: PTypeInfo; AComponentClass: TClass; const APropertyName: string; AEditorClass: TcxPropertyEditorClass);

Description

For every edited property the runtime object inspector uses property editor. To bind a custom editor to the edited property Delphi requires registering it with the property. This procedure registers the TcxPropertyEditor custom editor with the edited property type. The cxRegisterPropertyEditor procedure has the following parameters:

•	The APropertyType parameter is a pointer to the TTypeInfo record. For example, TypeInfo(Boolean) identifies the edited property of a Boolean type.

•	The AComponentClass parameter identifies the type of the component to which this editor applies. If this parameter is nil the editor applies to all properties of the given type.

•	The APropertyName parameter represents the name of the property. This parameter only has meaning if the previous parameter specifies a particular type of component. In that case you can specify the name of a particular property in that component type to which this editor applies.

•	The AEditorClass parameter specifies the type of property editor used for editing the specified property.

The example for the full notation for the cxRegisterPropertyEditor procedure will be:

//Delphi

cxRegisterPropertyEditor(TypeInfo(Boolean), nil, '', TcxBoolProperty);


TcxPropertyAttribute
TcxPropertyAttribute type

Specifies the edited property attributes.

Unit

cxOI

TcxPropertyAttribute = (ipaValueList, ipaSubProperties, ipaDialog, ipaMultiSelect, ipaAutoUpdate, ipaSortList, ipaReadOnly, ipaRevertable);

Description

Specifies the edited property attributes. A subset of attributes defined for every type of the edited property is returned by the appropriate GetAttributes method of the bound to the edited property TcxPropertyEditor derived editor.

Flag	Meaning
ipaValueList	The editor can give a list of enumerated values.
ipaSubProperties	The property has subproperties that can be displayed.
ipaDialog	The editor can display a dialog box for editing the property.
ipaMultiSelect	The property is available when the user selects more than one inspected component.
ipaAutoUpdate	The inspected component is updated after every change instead of waiting for approval of the value.
ipaSortList	The value list should be sorted.
ipaReadOnly	Users cannot modify the property value.
ipaRevertable	Enables the reverting to the inherited menu item on the runtime object inspector’s context menu. The menu item tells the edited property editor to discard the current property value and return to some previously established default or standard value.


TcxPropertyAttributes
TcxPropertyAttributes type

Represents the type of the GetAttributes method return value.

Unit

cxOI

TcxPropertyAttributes = set of TcxPropertyAttribute;

Description

The TcxPropertyAttributes type is a set of the TcxPropertyAttribute type and used for type declaration of the GetAttributes method return value. The GetAttributes method defines the edited property attributes for every TcxPropertyEditor editor bound to the edited property.


cxVGrid Unit Overview
cxVGrid Unit

Classes

TcxCaptionRowProperties

TcxCategoryRow

TcxCategoryRowStyles

TcxCollectionItemEditorRowProperties

TcxCustomEditorRow

TcxCustomEditorRowProperties

TcxCustomMultiEditorRow

TcxCustomRow

TcxCustomRowHeaderInfo

TcxCustomRowProperties

TcxCustomVerticalGrid

TcxEditorPropertiesCollection

TcxEditorRow

TcxEditorRowItemProperties

TcxEditorRowProperties

TcxEditorRowStyles

TcxMultiEditorRow

TcxMultiEditorRowProperties

TcxRowCaptionInfo

TcxRowValueInfo

TcxUnboundVerticalGrid

TcxVerticalGrid

TcxVerticalGridCustomizing

TcxVerticalGridRows

TcxVerticalGridStyles

TcxvgHitTest

TcxvgMultiRecordsOptionsBehavior

TcxvgMultiRecordsOptionsData

TcxvgOptionsBehavior

TcxvgOptionsView

TcxVirtualVerticalGrid

Other Types

TcxvgGridLines

TcxvgLayoutStyle

TcxvgPaintStyle

TcxvgUnboundLayoutStyle

TSeparatorKind


TcxCategoryRowStyles
TcxCategoryRowStyles Object

Hierarchy          Properties          See Also

Contains the category row style settings.

Unit

cxVGrid

TcxCategoryRowStyles = class(TcxvgCustomRowStyles)

Description

The TcxCategoryRowStyles object is exposed via the TcxCategoryRow.Styles property and allows you to specify the style settings of a category row (see Header).


TcxCategoryRowStyles Hierarchy
Hierarchy

TcxStyles

     |

TcxvgCustomRowStyles

     |


Properties for TcxCategoryRowStyles
TcxCategoryRowStyles Properties

TcxCategoryRowStyles          Legend

In TcxCategoryRowStyles

Header


TcxCategoryRowStyles.Header

TcxCategoryRowStyles

Specifies the style for the category row.

property Header: TcxStyle;

Description

The Header property exposes the TcxStyle object and its interface lets you specify the background and text color of the category row’s header, the font settings and the bitmap assigned to it.


TcxCollectionItemEditorRowProperties
TcxCollectionItemEditorRowProperties Object

Hierarchy          Properties          Methods          Events

Represents a base class for the multi editor row items.

Unit

cxVGrid

TcxCollectionItemEditorRowProperties = class(TcxCustomEditorRowProperties)

Description

The TcxCollectionItemEditorRowProperties class is the ancestor for the TcxDBEditorRowItemProperties and TcxEditorRowItemProperties classes.  These classes represent individual items within the data-aware and simple multi editor rows respectively.  A multi editor row item represents an individual data cell.

The TcxCollectionItemEditorRowProperties class inherits the following functionality from its ancestor:

•	the Values property, providing access to the row values;

•	the RepositoryItem, EditProperties and EditPropertiesClass properties, specifying the edit repository item or the edit properties class for editing the row values;

•	the Options property,  providing access to various row options.

Thus, each multi editor row item functions as a single editor row.


TcxCollectionItemEditorRowProperties Hierarchy
Hierarchy

TcxInterfacedCollectionItem

     |

TcxCustomRowProperties

     |

TcxCaptionRowProperties

     |

TcxCustomEditorRowProperties

     |


Properties for TcxCollectionItemEditorRowProperties
TcxCollectionItemEditorRowProperties Properties

TcxCollectionItemEditorRowProperties          Legend

In TcxCollectionItemEditorRowProperties

Width

Derived from TcxCustomEditorRowProperties

EditProperties

EditPropertiesClass

Options

RepositoryItem

Value

Values

Derived from TcxCaptionRowProperties

Caption

HeaderAlignmentHorz

HeaderAlignmentVert

Hint

ImageIndex

Derived from TcxCustomRowProperties

Row


Methods for TcxCollectionItemEditorRowProperties
TcxCollectionItemEditorRowProperties Methods

TcxCollectionItemEditorRowProperties          Legend

In TcxCollectionItemEditorRowProperties

CreateEx

Derived from TcxCustomEditorRowProperties

Assign

CreateEx

Derived from TcxCaptionRowProperties

CreateEx

DefaultCaption

RestoreDefaults

Derived from TcxCustomRowProperties

CreateEx


Events for TcxCollectionItemEditorRowProperties
TcxCollectionItemEditorRowProperties Events

TcxCollectionItemEditorRowProperties          Legend

Derived from TcxCustomEditorRowProperties

OnGetDisplayText

OnGetEditingProperties

OnGetEditProperties


TcxCollectionItemEditorRowProperties.Width

TcxCollectionItemEditorRowProperties

Specifies the width of a multi editor row item.

property Width: Integer;

Description

You can use the Width property to determine the width of a multi editor row item.  The minimum Width property value is 20.

How the multi editor row width changes depends on the MultiEditorRow.Properties.Fixed property value.  If this property is True, then each row item occupies the entire Width specified. Otherwise, the data column’s width is shared equally among all multi editor row items.

The default value of the Width property is 50.


TcxCollectionItemEditorRowProperties.CreateEx

TcxCollectionItemEditorRowProperties

Creates a new TcxCollectionItemEditorRowProperties object.

constructor CreateEx(ARow: TcxCustomRow); override;

Description

The CreateEx creates a new instance of the TcxCollectionItemEditorRowProperties class.  The ARow parameter specifies the row owning the created instance.

Do not call this method to create multi editor row items.  Use the Add method to add a new multi editor row item to the MultiEditorRow.Properties.Editors collection.


TcxCustomRowHeaderInfo
TcxCustomRowHeaderInfo Object

Hierarchy          Properties

Contains view information about a row header.

Unit

cxVGrid

TcxCustomRowHeaderInfo = class(TObject)

Description

The TcxCustomRowHeaderInfo class is the base class for objects containing the view information about row headers (TcxEditorRowHeaderInfo, TcxCategoryRowHeaderInfo, TcxMultiEditorRowHeaderInfo).

The properties of this object specify:

•	row header caption,

•	whether the row is focused,

•	the painting style applied to the row,

•	rectangles of all the row’s elements: focus area, indents and the row data cells.

An instance of the TcxCustomRowHeaderInfo class is passed as the OnDrawRowHeader event parameter.  The type of object returned via this parameter depends on the row type so a typecast must be performed to access properties that are specific to the row type.


TcxCustomRowHeaderInfo Hierarchy
Hierarchy

TObject

     |


Properties for TcxCustomRowHeaderInfo
TcxCustomRowHeaderInfo Properties

TcxCustomRowHeaderInfo          Legend

In TcxCustomRowHeaderInfo

ButtonColor

ButtonRect

CaptionsInfo

CategoryIndents

Focused

FocusRect

HeaderCellsRect

HeaderRect

IndentBounds

LinesInfo

Row

RowIndents

ShowButton

VerticalGrid

ViewParams


TcxCustomRowHeaderInfo.ButtonColor

TcxCustomRowHeaderInfo

Returns the background color of the expand button.

property ButtonColor: TColor;

Description

Read the ButtonColor property to obtain the background color of the row’s expand button.  The background color of the expand button depends on the style settings applied to the row.

If expand buttons are disabled via the ShowButton or the OptionsView.ShowButtons properties, this property returns clBlack.

ReadOnly Property


TcxCustomRowHeaderInfo.ButtonRect

TcxCustomRowHeaderInfo          See Also

Returns the rectangle the expand button occupies.

property ButtonRect: TRect;

Description

You can use the ButtonRect property to obtain a TRect structure describing the rectangle occupied by the expand button within the row.

You can determine whether the row contains an expand button using the ShowButton property. Additionally, the expand button’s background color is available via ButtonColor.

Note: if the expand button is disabled, this property returns a rectangle with zero height and width.

ReadOnly Property


TcxCustomRowHeaderInfo.CaptionsInfo

TcxCustomRowHeaderInfo

Provides access to the list of objects containing row captions’ view information.

property CaptionsInfo: TcxCaptionInfoList;

Description

The CaptionsInfo property exposes the TcxCaptionInfoList object representing the list of objects containing view information for row header captions.  This list contains TcxRowCaptionInfo instances.

TcxRowCaptionInfo provides access to:

•	the caption itself,

•	the caption’s rectangle,

•	the rectangles of the caption’s texts,

•	the index of the image displayed beside the caption.

The number of entries within the CaptionsInfo list depends on the row type: one for an editor row and multiple entries for a multi editor row (corresponding to the individual multi editor row items).

ReadOnly Property


TcxCustomRowHeaderInfo.CategoryIndents

TcxCustomRowHeaderInfo          See Also

Contains information about category indents within the row header.

property CategoryIndents: TIndentInfoList;

Description

The CategoryIndents property exposes the TIndentInfoList object whose interface can be used to obtain information about the indents of the category rows within the current row header. Using this object’s properties, you can determine the number of category indents and enumerate them (see TIndentInfoList.Items).

ReadOnly Property


TcxCustomRowHeaderInfo.Focused

TcxCustomRowHeaderInfo          See Also

Indicates whether the row header is focused.

property Focused: Boolean;

Description

Read the Focused property to determine whether the row header is currently focused. Additionally, you can get access to the focused row using the VerticalGrid.FocusedRow property.

ReadOnly Property


TcxCustomRowHeaderInfo.FocusRect

TcxCustomRowHeaderInfo          See Also

Returns the rectangle of the row header focus.

property FocusRect: TRect;

Description

Read the FocusRect property to obtain a TRect structure describing the row header focus rectangle. Additionally, you can determine whether the row header is focused via the Focused property.

ReadOnly Property


TcxCustomRowHeaderInfo.HeaderCellsRect

TcxCustomRowHeaderInfo          See Also

Returns the rectangle occupied by the row header cells.

property HeaderCellsRect: TRect;

Description

Read the HeaderCellsRect property to obtain the rectangle describing the area occupied by the row header cells. If the current row is multi editor, the HeaderCellsRect is comprised of rectangles of all its header cells. You can use the TcxCaptionInfoList object exposed via the CaptionsInfo property to get access to individual header cells.

You can obtain the rectangle occupied by the row header using the HeaderRect property.

ReadOnly Property


TcxCustomRowHeaderInfo.HeaderRect

TcxCustomRowHeaderInfo          See Also

Returns the rectangle for the entire header.

property HeaderRect: TRect;

Description

Read the HeaderRect property to determine the rectangle occupied by the whole row header. The row header rectangle contains areas occupied by row indents (see RowIndents), category indents (see CategoryIndents) and header cells rectangles (see HeaderCellsRect).


TcxCustomRowHeaderInfo.IndentBounds

TcxCustomRowHeaderInfo          See Also

Returns the indent bounds rectangle of the row header.

property IndentBounds: TRect;

Description

Read the IndentBounds property to obtain the rectangle describing the indent area of the current row header. This area is comprised of a sum of the areas of the row indents (see RowIndents) and category indents (see CategoryIndents).

ReadOnly Property


TcxCustomRowHeaderInfo.LinesInfo

TcxCustomRowHeaderInfo

Returns view information about a row’s header lines.

property LinesInfo: TLineInfoList;

Description

The LinesInfo property exposes the TLineInfoList object, whose interface can be used to obtain view information about a grid row’s header lines.

ReadOnly Property


TcxCustomRowHeaderInfo.Row

TcxCustomRowHeaderInfo

Returns the grid row to which the row header belongs.

property Row: TcxCustomRow;

Description

Read the Row property to get the grid row owning the current row header.

ReadOnly Property


TcxCustomRowHeaderInfo.RowIndents

TcxCustomRowHeaderInfo          See Also

Provides row’s indent rectangles.

property RowIndents: TIndentInfoList;

Description

The RowIndents property exposes the TIndentInfoList object, which allows you to determine the number of row indents within the row header, iterate them and obtain the display rectangles for each one.

Additionally, you can obtain the rectangles for category indents (see CategoryIndents), header cells (see HeaderCellsRect) and the rectangle for the entire row header (see HeaderRect).

ReadOnly Property


TcxCustomRowHeaderInfo.ShowButton

TcxCustomRowHeaderInfo          See Also

Indicates whether the row header contains an expand button.

property ShowButton: Boolean;

Description

Read the ShowButton property to determine whether the row header contains an expand button. A row header contains an expand button when all the following conditions are met: the ShowButtons and ShowHeaders options are enabled and the row has visible child rows (see TcxCustomRow.HasVisibleChildren).

Additionally, you can obtain the display rectangle of the expand button via the ButtonRect property.

ReadOnly Property


TcxCustomRowHeaderInfo.VerticalGrid

TcxCustomRowHeaderInfo

Provides access to the vertical grid control owning the row header.

property VerticalGrid: TcxCustomVerticalGrid;

Description

Read the VerticalGrid property to get access to the vertical grid control owning the row to which the row header belongs.

ReadOnly Property


TcxCustomRowHeaderInfo.ViewParams

TcxCustomRowHeaderInfo

Provides the row header’s view parameters.

property ViewParams: TcxViewParams;

Description

The ViewParams property exposes the TcxViewParams object that can be used to obtain the background and text color, font settings and the bitmap assigned to the row header. The property can be useful when painting row headers.

Note: you cannot change the values of the view parameters. In order to specify another bitmap, font settings, text and background color you should use the vertical grid control’s styles.


TcxCustomVerticalGrid
TcxCustomVerticalGrid Object

Hierarchy          Properties          Methods          Events

Represents a base class for vertical grids.

Unit

cxVGrid

TcxCustomVerticalGrid = class(TcxExtEditingControl)

Description

The TcxCustomVerticalGrid provides the base class for TcxVerticalGrid, TcxVirtualVerticalGrid,  TcxDBVerticalGrid and TcxRTTIInspector. The TcxCustomVerticalGrid implements common functionality for these classes.

The main element of a vertical grid control is a row (see the Rows Overview topic).  The TcxCustomVerticalGrid class provides a number of properties and methods to add or delete its rows, navigate rows and to access individual rows.  You can access the vertical grid’s rows via the Rows property (see the Accessing Rows topic).

The vertical grid control has several option sets controlling different aspects of its behavior and appearance. These include:

•	OptionsBehavior, containing settings which determine the response to user actions;

•	OptionsData, determining the data-aware functionality;

•	OptionsView, containing appearance options.

The vertical grid control provides several ways of managing its appearance.  A custom painting mechanism is available by handling three events:

•	OnDrawBackground – allows painting of the vertical grid control background;

•	OnDrawRowHeader – allows painting of the row headers;

•	OnDrawValue – allows painting of the row values.

Another method of managing the grid’s appearance is to use the Styles property.  It allows assigning different visual styles (background color and font settings) to various control elements: background, cell contents, row headers, category rows, selected row, etc.  See the Styles Overview topic for details.

The TcxCustomVerticalGrid class implements a saving/restoring mechanism.  The StoreTo…/RestoreFrom… methods allow saving to/restoring from three storage types: INI-file, registry and a stream.


TcxCustomVerticalGrid Hierarchy
Hierarchy

TcxExtEditingControl

     |


Properties for TcxCustomVerticalGrid
TcxCustomVerticalGrid Properties

TcxCustomVerticalGrid          Legend

In TcxCustomVerticalGrid

Customizing

FocusedRow

HitTest

Images

InplaceEditor

IsEditing

OptionsBehavior

OptionsData

OptionsView

Rows

StoringName

Styles

TopVisibleRowIndex

ViewInfo


Methods for TcxCustomVerticalGrid
TcxCustomVerticalGrid Methods

TcxCustomVerticalGrid          Legend

In TcxCustomVerticalGrid

Add

AddChild

AssignRows

CancelEdit

ClearRows

FirstRow

FirstVisibleRow

FocusRow

FullCollapse

FullExpand

HasRows

HasVisibleRows

HideEdit

IsInternalDragging

IsRowVisible

LastRow

LastVisibleRow

NextRow

NextVisibleRow

PrevRow

PrevVisibleRow

Remove

RestoreDefaults

RestoreFromIniFile

RestoreFromRegistry

RestoreFromStream

RowByCaption

RowByName

ShowEdit

ShowEditByKey

ShowEditByMouse

StoreToIniFile

StoreToRegistry

StoreToStream


Events for TcxCustomVerticalGrid
TcxCustomVerticalGrid Events

TcxCustomVerticalGrid          Legend

In TcxCustomVerticalGrid

OnDrawBackground

OnDrawRowHeader

OnDrawValue

OnItemChanged

OnLeftVisibleBandIndexChanged

OnLeftVisibleRecordIndexChanged

OnTopRowIndexChanged


TcxCustomVerticalGrid.Customizing

TcxCustomVerticalGrid

Provides access to the customization box.

property Customizing: TcxVerticalGridCustomizing;

Description

The Customizing property exposes the TcxVerticalGridCustomizing object that represents the customization box.  The customization box allows the end user to of remove/restore rows within the grid control.

To enable the customization box set the Customizing.Visible property to True.


TcxCustomVerticalGrid.FocusedRow

TcxCustomVerticalGrid          See Also

Returns the focused row.

property FocusedRow: TcxCustomRow;

Description

You can use the FocusedRow property to get the currently focused row. If no row is focused, the property returns nil.

You can also assign a row to the property to shift focus to it.  Consider the following code:

//Delphi

type

  merWork: TcxDBMultiEditorRow;

//...

cxDBVerticalGrid.FocusedRow := merWork;


TcxCustomVerticalGrid.HitTest

TcxCustomVerticalGrid

Contains current hit information.

property HitTest: TcxvgHitTest;

Description

The HitTest property exposes the TcxvgHitTest object whose interface allows you to determine the vertical grid visual element the mouse pointer is currently over.  An example of using the HitTest property to determine the vertical grid element under the mouse cursor is demonstrated in Implementing Drag-And-Drop Operations topic.

ReadOnly Property


TcxCustomVerticalGrid.Images

TcxCustomVerticalGrid

Returns the images associated with the vertical grid.

property Images: TImageList;

Description

The Images property exposes the TImageList object that is used to store images used by the vertical grid.  These images can be displayed within the category rows.  Use the Row.Properties.ImageIndex property to associate an image with a row.


TcxCustomVerticalGrid.InplaceEditor

TcxCustomVerticalGrid

Gets the TcxCustomEdit object representing the active in-place editor that enables the user to edit value in the current data cell.

property InplaceEditor: TcxCustomEdit;

Description

This property provides a reference to the TcxCustomEdit object if the value of the IsEditing property is True. Otherwise the InplaceEditor property returns a nil value.

ReadOnly Property


TcxCustomVerticalGrid.IsEditing

TcxCustomVerticalGrid          See Also

Indicates whether the in-place editor is active in the current data cell.

property IsEditing: Boolean;

Description

Indicates whether the in-place editor is active in the current data cell.

ReadOnly Property


TcxCustomVerticalGrid.OptionsBehavior

TcxCustomVerticalGrid          See Also

Provides access to options controlling the vertical grid’s behavior.

property OptionsBehavior: TcxvgOptionsBehavior;

Description

The OptionsBehavior property exposes the TcxvgOptionsBehavior object that determines vertical grid behavior for the end user. You can determine, for instance, whether the user can resize grid rows (see RowSizing) and headers (see HeaderSizing), whether the in-place editors should always be shown (see AlwaysShowEditor) and other options.

Also, you can control the grid’s layout (see OptionsView) and data-aware operations (see OptionsData).


TcxCustomVerticalGrid.OptionsData

TcxCustomVerticalGrid          See Also

Provides access to options controlling vertical grid data operations.

property OptionsData;

Description

The OptionsData property exposes the TcxControlOptionsData object that can be used to determine whether the grid should discard a row cell’s changes if the end user has not confirmed them, or whether cell editing is enabled at all.

Also, you can control the grid’s layout (see OptionsView) and user interaction options (see OptionsBehavior).


TcxCustomVerticalGrid.OptionsView

TcxCustomVerticalGrid          See Also

Provides access to options controlling vertical grid layout.

property OptionsView: TcxvgOptionsView;

Description

The OptionsView property exposes the TcxvgOptionsView object that can be used to determine a number of grid layout parameters including, for instance, the grid lines displayed by the control (see GridLines), the painting style applied (see PaintStyle), whether row headers (see ShowHeaders) or expand buttons (see ShowButtons) are enabled etc.

Also, you can specify data-aware options (see OptionsData) and user interaction options (see OptionsBehavior).


TcxCustomVerticalGrid.Rows

TcxCustomVerticalGrid

Returns the collection of rows within the control.

property Rows: TcxVerticalGridRows;

Description

The Rows property exposes the TcxVerticalGridRows object whose interface can be used to enumerate and get access to individual rows within the control.

The following code checks whether the second row within the vertical grid control has child rows and expands it accordingly:

// Delphi

with cxDBVerticalGrid.Rows[1] do

begin

  if HasChildren then Expand(True);

end;


TcxCustomVerticalGrid.StoringName

TcxCustomVerticalGrid          See Also

Specifies the string to replace the vertical grid control’s name in saving/restoring operations.

property StoringName: String;

Description

Use the StoringName property to specify the string representing the vertical control within the storage.  If this property value is not specified, then the vertical grid class instance name is used to identify the stored object.


TcxCustomVerticalGrid.Styles

TcxCustomVerticalGrid          See Also

Provides the style settings for various grid elements.

property Styles: TcxVerticalGridStyles;

Description

The Styles property exposes the TcxVerticalGridStyles object that can be used to determine the style settings of various vertical grid visual elements. You can determine the style settings, for instance, of the grid background (see Background), the category rows (see Category), the content (see Content) and headers (see Header), the selected area (see Selection) and other elements.


TcxCustomVerticalGrid.TopVisibleRowIndex

TcxCustomVerticalGrid          See Also

Specifies the index of the top-most visible row.

property TopVisibleRowIndex: Integer;

Description

Use the TopVisibleRowIndex property to specify the index of the top most visible row.  Assigning a new value to this property makes the row with the specified index the top most visible row.

If the row whose index is specified as the TopVisibleRowIndex value is not currently visible, then the vertical grid control is scrolled until the required row appears (or becomes the top most visible row).


TcxCustomVerticalGrid.ViewInfo

TcxCustomVerticalGrid          See Also

Provides the view information about the vertical grid.

property ViewInfo: TcxvgCustomViewInfo;

Description

The ViewInfo property exposes the TcxvgCustomViewInfo object whose interface can be used to obtain various view information about the vertical grid control.

ReadOnly Property


TcxCustomVerticalGrid.Add

TcxCustomVerticalGrid          See Also

Adds a new row to the control.

function Add(ARowClass: TcxCustomRowClass): TcxCustomRow;

Description

The Add method can be used to create and add a new row to the vertical grid control.

The ARowClass parameter specifies the class of the row to be created. Note that this parameter should never be nil. The TcxCustomVerticalGrid descendant classes check whether they can contain a row of the type passed via the parameter. If the type is not acceptable, a cxVerticalGridError exception is raised. The following table displays the types of row that TcxCustomVerticalGrid descendants can contain.

TcxCustomVerticalGrid descendants	TcxCustomRow descendants
	TcxCategoryRow	TcxEditorRow	TcxMultiEditorRow	TcxDBEditorRow
TcxVerticalGrid	+	+	+	-
TcxVirtualVerticalGrid	+	+	+	-
TcxDBVerticalGrid	+	-	-	+
TcxRTTIInspector	+	-	+	-

By default, the new row is added to the end of the first level’s rows collection. The new row’s position is specified via the Row.Index property. The following sample demonstrates how to add a new row to the beginning of the first level’s rows collection:

// Delphi

VerticalGrid1.Add(TcxCategoryRow).Index := 0;

// C++ Builder

VerticalGrid1->Add(TcxCategoryRow).Index = 0;

To add a new row as a child of another one, you should use the AddChild method.

Also, you can copy all the rows from another vertical grid control via the AssignRows method.


TcxCustomVerticalGrid.AddChild

TcxCustomVerticalGrid          See Also

Adds a new child row to the control.

function AddChild(AParent: TcxCustomRow; ARowClass: TcxCustomRowClass): TcxCustomRow;

Description

The AddChild method creates and adds a new child row to the grid control.

The AParent parameter specifies the parent row for the new row.

The ARowClass parameter specifies the class of the row to be created. Note: this parameter should never be nil. The TcxCustomVerticalGrid descendant classes check whether they can contain a row of the type passed via this parameter. If the type is not acceptable, a cxVerticalGridError exception is raised. The following table displays the types of row that TcxCustomVerticalGrid descendants can contain.

TcxCustomVerticalGrid descendants	TcxCustomRow descendants
	TcxCategoryRow	TcxEditorRow	TcxMultiEditorRow	TcxDBEditorRow
TcxVerticalGrid	+	+	+	-
TcxVirtualVerticalGrid	+	+	+	-
TcxDBVerticalGrid	+	-	-	+
TcxRTTIInspector	+	-	+	-

By default, the new row is added to the end of the specified row’s collection. You can specify the position of the row being added via the Index property.

To add a new non-child row, you should use the Add method.

Also, you can copy rows from another vertical grid control via the AssignRows method.


TcxCustomVerticalGrid.AssignRows

TcxCustomVerticalGrid          See Also

Copies a number of rows.

procedure AssignRows(Source: TcxCustomVerticalGrid); virtual;

Description

The AssignRows method replaces existing grid rows with those copied from another vertical grid.

Also, you can add new rows to the control by using the Add or AddChild methods. You can delete all the rows from the control by calling the ClearRows method.


TcxCustomVerticalGrid.CancelEdit

TcxCustomVerticalGrid          See Also

Terminates the editing of a row cell value.

procedure CancelEdit;

Description

The CancelEdit method hides the currently active inplace editor discarding any changes made by the end user.

Alternatively, you can hide the currently active inplace editor by calling the HideEdit method. This differs from CancelEdit in that it preserves the changes made. You can also display an inplace editor for the active row cell using ShowEdit.


TcxCustomVerticalGrid.ClearRows

TcxCustomVerticalGrid          See Also

Deletes all the rows from the control.

procedure ClearRows;

Description

You can use the ClearRows method to delete all the rows from the grid control.

After the rows have been deleted, you may wish to add new ones. This can be done either by adding row-by-row using the Add (or AddChild) method or by copying existing rows from another vertical grid control via AssignRows.


TcxCustomVerticalGrid.FirstRow

TcxCustomVerticalGrid          See Also

Returns the first row within the grid.

function FirstRow: TcxCustomRow;

Description

Use the FirstRow function to get access to the grid row (i.e. with AbsoluteIndex = 0). Since grid rows can be hidden, you can get access to the first visible row using FirstVisibleRow.

Note: if the vertical grid is empty, the method returns nil, so you should always consider checking the return value against nil before using the object.


TcxCustomVerticalGrid.FirstVisibleRow

TcxCustomVerticalGrid          See Also

Returns the first visible row within the grid.

function FirstVisibleRow: TcxCustomRow;

Description

Use the FirstVisibleRow to get access to the row located at the top of the grid.

Note: if the vertical grid contains no visible rows the method returns nil, so you should always consider checking the return value against nil before using the object.

Additionally, you can get access to the first row (visible or not) by using the FirstRow method.


TcxCustomVerticalGrid.FocusRow

TcxCustomVerticalGrid          See Also

Sets focus in the ACellIndex cell of the ARow row.

procedure FocusRow(ARow: TcxCustomRow; ACellIndex: Integer = 0);

Description

Use the FocusRow method to set focus on the ARow row by code. The ACellIndex parameter is useful when working with multi editor rows because this parameter provides indexed access to the items in the multi editor row (see the TcxMultiEditorRowProperties.Editors property).


TcxCustomVerticalGrid.FullCollapse

TcxCustomVerticalGrid          See Also

Collapses all rows within the grid.

procedure FullCollapse;

Description

Use the FullCollapse method to collapse all rows within the grid control. Note: hidden rows are collapsed.

You can expand all rows using the FullExpand method.


TcxCustomVerticalGrid.FullExpand

TcxCustomVerticalGrid          See Also

Expands all rows within the control.

procedure FullExpand;

Description

Use the FullExpand method to expand all rows within the control. Note: hidden rows are expanded.

You can collapse all rows at once using the FullCollapse method.


TcxCustomVerticalGrid.HasRows

TcxCustomVerticalGrid          See Also

Indicates whether the control contains rows.

function HasRows: Boolean;

Description

Use the HasRows to determine whether the grid control contains any rows (visible and hidden).

To determine whether the control has visible rows, you should use the HasVisibleRows method instead.


TcxCustomVerticalGrid.HasVisibleRows

TcxCustomVerticalGrid          See Also

Indicates whether the control has visible rows.

function HasVisibleRows: Boolean;

Description

Use the HasVisibleRows to determine whether the grid control contains any visible rows.

Note that a grid row can be invisible in the following two cases:

1)	its Visible property is set to False

2)	the Visible property of its parent row is set to False

Additionally, you can check if a specific grid row is visible using the IsRowVisible method.

To determine whether the grid contains any rows (visible and/or hidden), you should use the HasRows method instead.


TcxCustomVerticalGrid.HideEdit

TcxCustomVerticalGrid          See Also

Hides the currently active inplace editor.

procedure HideEdit;

Description

Use the HideEdit method to close and hide the current in-place editor. End user changes are preserved. You can hide the editor and discard changes by using the CancelEdit method.

Additionally, you can display the in-place editor for the focused row cell via the ShowEdit method.


TcxCustomVerticalGrid.IsInternalDragging

TcxCustomVerticalGrid

Returns whether a row is being dragged within a grid (or between a grid and the Customization Form).

function IsInternalDragging: Boolean;

Description

If a row is being dragged, the IsInternalDragging method returns True.


TcxCustomVerticalGrid.IsRowVisible

TcxCustomVerticalGrid          See Also

Indicates whether a particular row is visible.

function IsRowVisible(ARow: TcxCustomRow): Boolean;

Description

Use the IsRowVisible method to determine whether a specific grid row is visible.

The ARow parameter specifies the grid row being checked.

Note that a grid row can be invisible in the following cases:

1)	when its Visible property returns False

2)	when the Visible property of its parent row returns False

To get a row’s parent row, you should use its Parent property.

Additionally, you can determine whether the vertical grid control contains any visible rows using the HasVisibleRows method.


TcxCustomVerticalGrid.LastRow

TcxCustomVerticalGrid          See Also

Returns the last row within the grid.

function LastRow: TcxCustomRow;

Description

Use LastRow to get the last row within the control’s row collection. The collection is exposed via the grid control’s Rows property.

Note: if the vertical grid control is empty, the method returns nil, so you should always consider checking the return value against nil before using the row returned.

Additionally, you can get the last visible row using the LastVisibleRow method.


TcxCustomVerticalGrid.LastVisibleRow

TcxCustomVerticalGrid          See Also

Returns the last visible row.

function LastVisibleRow: TcxCustomRow;

Description

Use LastVisibleRow to get the last visible row within the control. The method’s implementation ensures that the row returned has its Visible property set to True and the row is not hidden within a collapsed row (see IsRowVisible).

Note: that if the vertical grid control does not contain any visible rows the method returns nil, so you should always consider checking the return value against nil before using the row returned.

Additionally, you can get the last row within the control’s row collection via the LastRow method.


TcxCustomVerticalGrid.NextRow

TcxCustomVerticalGrid          See Also

Returns the next row after the one specified.

function NextRow(ARow: TcxCustomRow): TcxCustomRow;

Description

The ARow parameter specifies the grid row before the one required.

Note: if the row specified by ARow is the last within the collection, the method returns nil. You should always check the return value against nil before using the object returned.  If the ARow parameter value is nil, then this method returns the FirstRow.

The method can be useful when it is necessary to iterate through the collection of rows within the control regardless of their visibility. Additionally, you can get the next visible row using the NextVisibleRow method.


TcxCustomVerticalGrid.NextVisibleRow

TcxCustomVerticalGrid          See Also

Returns the next visible row after the one specified.

function NextVisibleRow(ARow: TcxCustomRow): TcxCustomRow;

Description

The ARow parameter specifies the grid row before the one required.

Note: if the specified row is the last visible (see LastVisibleRow), the method returns nil. You should always check the return value against nil before using the object returned.  If the ARow parameter value is nil, this method returns the FirstVisibleRow.


TcxCustomVerticalGrid.PrevRow

TcxCustomVerticalGrid          See Also

Returns the previous row to the one specified.

function PrevRow(ARow: TcxCustomRow): TcxCustomRow;

Description

The ARow parameter specifies the grid row after the one required.

Note: if the row specified is the first within the rows collection (see Rows), the method returns nil. You should always check the return value against nil before using the object returned.  If the ARow parameter value is nil, this method returns the LastRow.


TcxCustomVerticalGrid.PrevVisibleRow

TcxCustomVerticalGrid          See Also

Returns the previous visible row to the one specified.

function PrevVisibleRow(ARow: TcxCustomRow): TcxCustomRow;

Description

The ARow parameter specifies the grid row after the one required.

Note: if the row specified is the first visible row within the visible rows collection, the method returns nil. You should always check the return value against nil before using the object returned.  If the ARow parameter value is nil, this method returns the LastVisibleRow.

This method is useful when it is necessary to iterate backwards through the collection of visible rows. To do this for all rows within the control, you should use the PrevRow method instead.


TcxCustomVerticalGrid.Remove

TcxCustomVerticalGrid          See Also

Removes a row from the grid.

procedure Remove(ARow: TcxCustomRow);

Description

Use the Remove method to delete a particular row from the collection of grid rows (see Rows).

The ARow parameter specifies the row to be removed.

Additionally, you can remove all rows at once using the ClearRows method.


TcxCustomVerticalGrid.RestoreDefaults

TcxCustomVerticalGrid

Restores the grid’s default settings.

procedure RestoreDefaults; virtual;

Description

The RestoreDefaults method restores the default settings of the OptionsBehavior, OptionsView sets and the default Row.Options settings.


TcxCustomVerticalGrid.RestoreFromIniFile

TcxCustomVerticalGrid          See Also

Restores the layout of the vertical grid from an INI file.

procedure RestoreFromIniFile(AStorageName: String);

Description

You can use the RestoreFromIniFile method to restore the layout of the vertical grid from an INI file.  The AStorageName parameter defines the path and the name of the INI file from which the layout should be retrieved.  If the path to the storage file is not specified, then this method results in exception.

You can store the grid layout to an INI file using the StoreToIniFile method.


TcxCustomVerticalGrid.RestoreFromRegistry

TcxCustomVerticalGrid          See Also

Restores the grid layout from the registry.

procedure RestoreFromRegistry (AStorageName: string);

Description

You can use the RestoreFromRegistry method to restore the vertical grid layout from the Windows registry.

Adding the AStorageName suffix to the HKEY_CURRENT_USER key forms the registry path.

To store the grid layout to the registry, use the StoreToRegistry method.

Alternatively, you can restore the grid layout from an INI file or a stream using the RestoreFromIniFile and RestoreFromStream methods respectively.


TcxCustomVerticalGrid.RestoreFromStream

TcxCustomVerticalGrid          See Also

Restores the grid layout from a stream.

procedure RestoreFromStream(AStream: TStream);

Description

You can use the RestoreFromStream method to restore grid layout from a stream.

The AStream parameter specifies a TStream descendant containing the grid layout.

To store the grid layout to a stream, you should use the StoreToStream method.

Alternatively, you can restore the grid layout from an INI file or from the Windows registry using the RestoreFromIniFile and RestoreFromRegistry methods respectively.


TcxCustomVerticalGrid.RowByCaption

TcxCustomVerticalGrid          See Also

Retrieves a row by its caption.

function RowByCaption(const ACaption: String): TcxCustomRow;

Description

The RowByCaption method retrieves a grid row by its caption.

The ACaption parameter specifies the caption (see Caption) of the desired row.

Note: if the grid does not contain a row with this caption, the method returns nil.

Alternatively, you can use the RowByName method to get a grid row by its name.


TcxCustomVerticalGrid.RowByName

TcxCustomVerticalGrid          See Also

Retrieves a row by its name.

function RowByName(const AName: String): TcxCustomRow;

Description

The RowByName method retrieves a grid row by its name.

The AName parameter specifies the name of the row to obtain.

Note: if the grid does not contain a row with this name, the method returns nil.

Alternatively, you can obtain a row by its caption using the RowByCaption method.


TcxCustomVerticalGrid.ShowEdit

TcxCustomVerticalGrid          See Also

Activates the in-place editor of the active row cell.

procedure ShowEdit;

Description

Use ShowEdit to activate the in-place editor assigned to the active row cell. Note: this method is unavailable if editing of cell values (see OptionsData.Editing) is disabled.

Alternatively, you can show the focused cell’s in-place editor using the ShowEditByKey and ShowEditByMouse methods.

You can hide the in-place editor either accepting or discarding user changes by using the HideEdit or CancelEdit methods respectively.


TcxCustomVerticalGrid.ShowEditByKey

TcxCustomVerticalGrid          See Also

Activates the focused cell’s in-place editor and passes the specified key to it.

procedure ShowEditByKey(AKey: Char);

Description

You can use the ShowEditByKey method to activate an in-place editor and pass a character to it.

The AKey parameter specifies the char passed to the in-place editor after it is opened.

Alternatively, you can activate the in-place editor by mouse using the ShowEditByMouse method. You can also activate the in-place editor by simply calling the ShowEdit method.


TcxCustomVerticalGrid.ShowEditByMouse

TcxCustomVerticalGrid          See Also

Emulates manual activation of the focused cell’s in-place editor as if it was done using the mouse.

procedure ShowEditByMouse(X, Y: Integer; AShift: TShiftState);

Description

You can use the ShowEditByMouse method to activate the currently focused cell’s in-place editor by code that achieves the same result as an end user with the mouse.

The X and Y parameters specify the mouse cursor position and the AShift parameter specifies the keyboard shift state.

Alternatively, you can activate the in-place editor using the ShowEditByKey or ShowEdit methods.


TcxCustomVerticalGrid.StoreToIniFile

TcxCustomVerticalGrid          See Also

Stores the grid layout to an INI file.

procedure StoreToIniFile(AStorageName: String ; AReCreate: Boolean = True);

Description

You can use the StoreToIniFile method to store the vertical grid’s layout to an INI file. The method stores the PaintStyle, RowHeaderWidth and ValueWidth property values and the row structure: row indexes and their parent indexes, row heights and their expanded/collapsed status.

The AStorageName parameter determines the name of the INI file.

The AReCreate parameter specifies whether the INI file will be overwritten. Set the AReCreate parameter to False to store multiple layouts in a single file.

To restore the grid layout from an INI file, you can use the RestoreFromIniFile method.

Alternatively, you can store the grid layout to the Windows registry or to a stream using the StoreToRegistry and StoreToStream methods.


TcxCustomVerticalGrid.StoreToRegistry

TcxCustomVerticalGrid          See Also

Stores the grid layout to the Windows registry.

procedure StoreToRegistry(AStorageName: String; AReCreate: Boolean = True);

Description

You can use the StoreToRegistry method to store the vertical grid’s layout to the Windows registry. The method stores the PaintStyle, RowHeaderWidth and ValueWidth property values and the row structure: row indexes and their parent indexes, row heights and their expanded/collapsed status.

Adding the AStorageName suffix to the HKEY_CURRENT_USER key forms the registry path.

The AReCreate parameter specifies whether the information under the AStorageName suffix will be overwritten. Set the AReCreate parameter to False to store multiple layouts under the single AStorageName suffix.

To restore the grid layout from the registry, you should use the RestoreFromRegistry method.

Alternatively, you can store the grid layout to an INI file or to a stream using the StoreToIniFile and StoreToStream methods respectively.


TcxCustomVerticalGrid.StoreToStream

TcxCustomVerticalGrid          See Also

Stores the grid layout to a stream.

procedure StoreToStream(AStream: TStream);

Description

You can use the StoreToStream method to store the grid’s layout to a TStream descendant. The method stores the PaintStyle, RowHeaderWidth and ValueWidth property values and the row structure: row indexes and their parent indexes, row heights and their expanded/collapsed status.

The AStream parameter specifies the stream where the grid layout is to be stored.

To restore the grid layout from a stream, you should use the RestoreFromStream method.

Alternatively, you can store the grid layout to an INI file or to the Windows registry using the StoreToIniFile and StoreToRegistry methods respectively.


TcxCustomVerticalGrid.OnDrawBackground

TcxCustomVerticalGrid

Occurs before painting the vertical grid control’s background.

type

  TcxVerticalGridDrawBackgroundEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; const R: TRect; const AViewParams: TcxViewParams; var Done: Boolean) of object;

property OnDrawBackground: TcxVerticalGridDrawBackgroundEvent;

Description

The OnDrawBackground event is fired when the vertical grid control’s background needs repainting.

The Sender parameter specifies the vertical grid.

The ACanvas parameter specifies the surface being painted.

The R parameter represents the bounding rectangle of the vertical grid’s background.

The AViewParams parameter represents an object containing the display information about the painted area.

The Done parameter specifies whether the default painting routines should be suppressed. Set the parameter to True, to cancel default painting; set it to False, to allow default painting. In the latter case, the changes you make will be discarded.

The following OnDrawBackground event handler fills the background with a bitmap:

//Delphi

procedure TStylesSimpleDemoMainForm.cxDBVerticalGridDrawBackground(

  Sender: TObject; ACanvas: TcxCanvas; const R: TRect;

  const AViewParams: TcxViewParams; var Done: Boolean);

var

  AImage: TBitmap;

begin

  AImage := TBitmap.Create;

  AImage.LoadFromFile('c:\images\blue.bmp');

  ACanvas.FillRect(R, AImage);

  Done := True;

  AImage.Free;

end;

The code result is shown in the following image:


TcxCustomVerticalGrid.OnDrawRowHeader

TcxCustomVerticalGrid

Occurs before painting a grid row’s header.

type

  TcxVerticalGridDrawHeaderEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; APainter: TcxvgPainter; AHeaderViewInfo: TcxCustomRowHeaderInfo; var Done: Boolean) of object;

property OnDrawRowHeader: TcxVerticalGridDrawHeaderEvent;

Description

The OnDrawRowHeader event is fired when a grid row needs repainting.

The Sender parameter specifies the vertical grid control to which the row header belongs.

The ACanvas parameter specifies the surface being painted.

The APainter parameter represents the painter object used for default painting. You can use the interface provided by the object to paint the header using the current style settings.

The AHeaderViewInfo parameter specifies the object that provides view information about the row header being painted.

The Done parameter specifies whether the default painting routines should be suppressed. Set the parameter to True, to cancel default painting; set it to False, to allow default painting. In the latter case, the changes you make will be discarded.

The following OnDrawRowHeader event handler paints the category rows’ expand buttons in white or yellow depending on the row’s expanded state:

//Delphi

procedure TStylesSimpleDemoMainForm.cxDBVerticalGridDrawRowHeader(

  Sender: TObject; ACanvas: TcxCanvas; APainter: TcxvgPainter;

  AHeaderViewInfo: TcxCustomRowHeaderInfo; var Done: Boolean);

var

  AColor: TColor;

begin

  with AHeaderViewInfo do

  begin

    if Row.Expanded then

      AColor := clWhite

    else

      AColor := clYellow;

    APainter.Painter.DrawExpandButton(ACanvas, ButtonRect, Row.Expanded, AColor);

  end;

end;

The following image shows the effect of the code:

Note: the output shown above is produced only if the TcxLookAndFeel.NativeStyle property is set to False.


TcxCustomVerticalGrid.OnDrawValue

TcxCustomVerticalGrid

Occurs before painting row cell values.

type

  TcxVerticalGridDrawValueEvent = procedure(Sender: TObject; ACanvas: TcxCanvas; APainter: TcxvgPainter; AValueInfo: TcxRowValueInfo; var Done: Boolean) of object;

property OnDrawValue: TcxVerticalGridDrawValueEvent;

Description

The OnDrawValue event is fired when grid row cell values need repainting.

The Sender parameter specifies the vertical grid to which the row belongs.

The ACanvas parameter specifies the surface being painted.

The APainter parameter represents the painter object used for default painting. You can use the interface provided by the object to paint the cell value using the current style settings.

The AValueInfo parameter represents an object containing view information about the current cell value.

The Done parameter specifies whether the default painting routines should be suppressed. Set the parameter to True, to cancel default painting; set it to False, to allow default painting. In the latter case, the changes you make will be discarded.

The following code shows an OnDrawValue event handler that displays HP row values greater than 300 in red:

//Delphi

procedure TStylesSimpleDemoMainForm.cxDBVerticalGridDrawValue(

  Sender: TObject; ACanvas: TcxCanvas; APainter: TcxvgPainter;

  AValueInfo: TcxRowValueInfo; var Done: Boolean);

begin

if (TcxEditorRow(AValueInfo.Row).Properties.Caption = 'HP') and (cxDBVerticalGridHP.Properties.Values[AValueInfo.RecordIndex] > 300) then

begin

  ACanvas.Brush.Color := AValueInfo.ViewParams.Color;

  ACanvas.FillRect(AValueInfo.VisibleRect);

  ACanvas.Font.Color := clRed;

  ACanvas.Font.Style := [fsBold];

  ACanvas.DrawText(TcxCustomTextEditViewInfo(AValueInfo.EditViewInfo).Text, AValueInfo.BoundsRect, 0);

  Done := True;

end;

end;

The code result is shown in the following image:


TcxCustomVerticalGrid.OnItemChanged

TcxCustomVerticalGrid

Allows you to determine the previously focused row and cell after the focus has moved.

type

  TcxVerticalGridItemChangedEvent = procedure(Sender: TObject; AOldRow: TcxCustomRow; AOldCellIndex: Integer) of object;

property OnItemChanged: TcxVerticalGridItemChangedEvent;

Description

The OnItemChanged event is fired whenever the focus moves to another grid row or to a cell within the same row. You can use the event, for instance, to change the style settings of the row or row cell from where the focus has moved.

The Sender parameter represents the grid control that generated the event.

The AOldRow parameter represents the row from where the focus moved. To determine the currently focused row, you should use FocusedRow. Note: if no row was previously focused, the AOldRow parameter returns nil, so you should always check the parameter’s value against nil before using the object returned.

The AOldCellIndex parameter specifies the index of the cell previously focused. Note: if no row was previously focused, the AOldCellIndex parameter returns –1.


TcxCustomVerticalGrid.OnLeftVisibleBandIndexChanged

TcxCustomVerticalGrid          See Also

Fires for banded views when scrolling occurs.

type

  TNotifyEvent = procedure(Sender: TObject) of object;

property OnLeftVisibleBandIndexChanged: TNotifyEvent;

Description

The OnLeftVisibleBandIndexChanged event notifies you about the scrolling of banded grid views.

The Sender parameter provides the vertical grid control that initiated the event.

You can obtain the left visible band via the LeftVisibleBand property.

Additionally, you can track the horizontal scrolling of grid rows using the OnLeftVisibleRecordIndexChanged event.


TcxCustomVerticalGrid.OnLeftVisibleRecordIndexChanged

TcxCustomVerticalGrid          See Also

Allows you to track the horizontal scrolling of grid rows.

type

  TNotifyEvent = procedure(Sender: TObject) of object;

property OnLeftVisibleRecordIndexChanged: TNotifyEvent;

Description

The OnLeftVisibleRecordIndexChanged event is fired if the grid is displayed in bands view (see LayoutStyle) to notify you about horizontal scrolling of grid rows. The scrolling only occurs if the width of the vertical grid control is insufficient to display all its rows.

The Sender parameter specifies the vertical grid control that initiated the event.

You can determine the index of the top visible row via the TopVisibleRowIndex property.

Additionally, you can track the horizontal scrolling of grid bands using the OnLeftVisibleBandIndexChanged event.


TcxCustomVerticalGrid.OnTopRowIndexChanged

TcxCustomVerticalGrid

Allows you to track vertical scrolling of grid rows.

type

  TNotifyEvent = procedure(Sender: TObject) of object;

property OnTopRowIndexChanged: TNotifyEvent;

Description

The OnTopRowIndexChanged event is fired when the grid is displayed in single record view (see LayoutStyle) to notify you about vertical scrolling of grid rows.

The Sender parameter represents a vertical grid control that initiated the event.

You can determine the index of the top visible row using the TopVisibleRowIndex property.


TcxEditorPropertiesCollection
TcxEditorPropertiesCollection Object

Hierarchy          Properties          Methods

Represents a collection of multi editor row items.

Unit

cxVGrid

TcxEditorPropertiesCollection = class(TCollection)

Description

The TcxEditorPropertiesCollection object provides an interface that allows you to iterate through and access individual multi editor row items (see TcxCustomMultiEditorRow).  You can access the collection of multi editor row items via the MultiEditorRowProperties.Editors property.


TcxEditorPropertiesCollection Hierarchy
Hierarchy

TCollection

     |


Properties for TcxEditorPropertiesCollection
TcxEditorPropertiesCollection Properties

TcxEditorPropertiesCollection          Legend

In TcxEditorPropertiesCollection

Items

Row


Methods for TcxEditorPropertiesCollection
TcxEditorPropertiesCollection Methods

TcxEditorPropertiesCollection          Legend

In TcxEditorPropertiesCollection

Add


TcxEditorPropertiesCollection.Items

TcxEditorPropertiesCollection

Provides indexed access to multi editor row items.

property Items[Index: Integer]: TcxEditorRowItemProperties;

Description

The Items property exposes the TcxEditorRowItemProperties object whose interface can be used to bind a multieditor row item to data, obtain its value and determine the handlers for several events. You can use the Items property to iterate through the collection of multieditor row items within the current grid row.

The Index parameter specifies the zero-based index of the desired row item.

Additionally, you can use the TCollection.Count property to obtain the number of row items within the grid row.

ReadOnly Property


TcxEditorPropertiesCollection.Row

TcxEditorPropertiesCollection

Returns the multieditor row to which the collection belongs.

property Row: TcxCustomMultiEditorRow;

Description

The Row property exposes the TcxCustomMultiEditorRow object representing the multieditor grid row to which the collection belongs.

ReadOnly Property


TcxEditorPropertiesCollection.Add

TcxEditorPropertiesCollection

Adds a new editor item to the multi editor row.

function Add: TcxEditorRowItemProperties;

Description

You can use the Add method to add a new editor item to the multieditor row.

To get indexed access to the collection of the multieditor row’s row items, you should use the Items property.

Hint: Items is the default property, so you can omit its name using just index notation.

The following code demonstrates using the Add method to create a new item within a multi editor row:

//Delphi

with merCustomerInfo.Properties.Editors.Add do

begin

  Caption := 'Email';

  Options.Editing := False;

end;


TcxEditorRowStyles
TcxEditorRowStyles Object

Hierarchy          Properties

Provides access to the style settings of a vertical grid editor row.

Unit

cxVGrid

TcxEditorRowStyles = class(TcxCategoryRowStyles)

Description

The TcxEditorRowStyles object provides an interface that allows you to specify the style settings of a row’s header (see Header) and content (see Content).

The row styles can be accessed via the Row.Styles property.

Note: style settings applied to individual rows override the VerticalGrid.Styles settings.


TcxEditorRowStyles Hierarchy
Hierarchy

TcxStyles

     |

TcxvgCustomRowStyles

     |

TcxCategoryRowStyles

     |


Properties for TcxEditorRowStyles
TcxEditorRowStyles Properties

TcxEditorRowStyles          Legend

In TcxEditorRowStyles

Content

Derived from TcxCategoryRowStyles

Header


TcxEditorRowStyles.Content

TcxEditorRowStyles

Defines the style settings of a row’s item content.

property Content: TcxStyle;

Description

The Content property exposes the TcxStyle object whose interface can be used to define the style settings of the row’s item content.

Additionally, you can define the style settings of the row’s header via the Header property.


TcxRowCaptionInfo
TcxRowCaptionInfo Object

Hierarchy          Properties

Provides view information about a row item caption.

Unit

cxVGrid

TcxRowCaptionInfo = class(TPersistent)

Description

The TcxRowCaptionInfo object provides an interface that allows you to specify:

•	the text displayed within row item captions,

•	the rectangle area occupied by the item caption,

•	the collection of images assigned,

•	whether the caption is focused, etc.

You can access the list of TcxRowCaptionInfo objects via the CustomRowHeaderInfo.CaptionsInfo property.  The number of entries within this list depends on the row type: one for an editor row, multiple for the multi editor row (each entry corresponding to an individual multi editor row item).


TcxRowCaptionInfo Hierarchy
Hierarchy

TPersistent

     |


Properties for TcxRowCaptionInfo
TcxRowCaptionInfo Properties

TcxRowCaptionInfo          Legend

In TcxRowCaptionInfo

Caption

CaptionRect

CaptionTextRect

Focused

ImageIndex

ImageRect

Images

Row

RowCellIndex

ViewParams


TcxRowCaptionInfo.Caption

TcxRowCaptionInfo          See Also

Returns the text displayed within the row item caption.

property Caption: string;

Description

You can use the Caption property to obtain the text displayed within the row item caption. To change the caption text, you should use the Row.Properties.Caption property.

ReadOnly Property


TcxRowCaptionInfo.CaptionRect

TcxRowCaptionInfo

Returns the rectangle of the row item caption.

property CaptionRect: TRect;

Description

Use the CaptionRect property to get the rectangle area occupied by the item caption. Additionally, you can obtain the rectangle of the caption’s text via the CaptionTextRect property.

ReadOnly Property


TcxRowCaptionInfo.CaptionTextRect

TcxRowCaptionInfo

Returns the rectangle occupied by the row item’s caption text.

property CaptionTextRect: TRect;

Description

Use the CaptionTextRect property to obtain the rectangle area occupied by the row item’s caption text. To determine the rectangle of the entire caption, you should use the CaptionRect property.

ReadOnly Property


TcxRowCaptionInfo.Focused

TcxRowCaptionInfo

Indicates whether the row item caption is focused.

property Focused: Boolean;

Description

Read the Focused property to determine whether the row item caption is focused.  This can be usefull for drawing the focus rectangle when implementing custom painting.

ReadOnly Property


TcxRowCaptionInfo.ImageIndex

TcxRowCaptionInfo          See Also

Returns the index of the image assigned to a row caption item.

property ImageIndex: Integer;

Description

Read the ImageIndex property to obtain the index of the image assigned to a row caption item. To get access to the collection of images assigned to the vertical grid, you should use the VerticalGrid.Images property.

Additionally, you can obtain the rectangle of the image assigned via the ImageRect property.

ReadOnly Property


TcxRowCaptionInfo.ImageRect

TcxRowCaptionInfo          See Also

Returns the rectangle of the area occupied by the item’s caption image.

property ImageRect: TRect;

Description

Read the ImageRect property to obtain the rectangle of the area occupied by the item’s caption image. To determine the index of the image assigned to the caption, you should use the ImageIndex property.

To get the collection of images used by the vertical grid, you should use the Images property.

ReadOnly Property


TcxRowCaptionInfo.Images

TcxRowCaptionInfo

Returns the collection of images used by the vertical grid.

property Images: TImageList;

Description

Read the Images property to obtain the collection of images used by the vertical grid control.

To determine the index of the image assigned to the row item caption, you should use the ImageIndex property. Additionally, you can obtain the rectangle occupied by the item’s caption image via the ImageRect property.

ReadOnly Property


TcxRowCaptionInfo.Row

TcxRowCaptionInfo          See Also

Returns the row to which the caption belongs.

property Row: TcxCustomRow;

Description

Read the Row property to get the grid row to which the row item caption belongs.

ReadOnly Property


TcxRowCaptionInfo.RowCellIndex

TcxRowCaptionInfo

Returns the row caption’s corresponding row cell.

property RowCellIndex: Integer;

Description

Read the RowCellIndex property to determine the row caption’s corresponding row cell. In case of a simple editor row, the property returns 0.


TcxRowCaptionInfo.ViewParams

TcxRowCaptionInfo

Provides access to the view parameters of the row item caption.

property ViewParams: TcxViewParams;

Description

The ViewParams property exposes the TcxViewParams object whose interface can be used to determine the background and text color, the font settings and the bitmap assigned to the row item caption. Note: you cannot change the values of these parameters. In order to do this, you should use styles.  See the Styles Overview topic for more information on vertical grid styles.

ReadOnly Property


TcxRowValueInfo
TcxRowValueInfo Object

Hierarchy          Properties

Provides view information about a row’s data cell.

Unit

cxVGrid

TcxRowValueInfo = class(TcxEditCellViewInfo)

Description

The TcxRowValueInfo object provides view information on a row data cell.  This information includes:

•	whether the current cell is focused,

•	the cell index within the row,

•	the value the cell contains, etc.

An instance of the TcxRowValueInfo class is passed as the VerticalGrid.OnDrawValue event parameter.


TcxRowValueInfo Hierarchy
Hierarchy

TcxEditCellViewInfo

     |


Properties for TcxRowValueInfo
TcxRowValueInfo Properties

TcxRowValueInfo          Legend

In TcxRowValueInfo

Focused

Row

RowCellIndex

Derived from TcxEditCellViewInfo

Borders

ContentRect

DisplayValue

Focused

RecordIndex


TcxRowValueInfo.Focused

TcxRowValueInfo          See Also

Indicates whether the row data cell is focused.

property Focused;

Description

Read the Focused property to determine whether the current row data cell is focused.

Additionally, you can obtain the focused row via the FocusedRow property. Note though that if there is no focused row, this property returns nil, so you should always check the value returned against nil before operating on the object.


TcxRowValueInfo.Row

TcxRowValueInfo

Returns the row to which the data cell belongs.

property Row: TcxCustomRow;

Description

Read the Row property to get access to the row owning the data cell.

ReadOnly Property


TcxRowValueInfo.RowCellIndex

TcxRowValueInfo

Returns the cell index to which the value belongs.

property RowCellIndex: Integer;

Description

Multi editor rows can contain multiple header and data cells.  Read the RowCellIndex property to obtain the zero-based index of the row cell containing the value.

ReadOnly Property


TcxVerticalGridStyles
TcxVerticalGridStyles Object

Hierarchy          Properties          Events          See Also

Provides access to the grid’s style settings.

Unit

cxVGrid

TcxVerticalGridStyles = class(TcxCustomControlStyles)

Description

The TcxVerticalGridStyles object is exposed via the Styles property and introduces an interface that allows you to define the style settings of a number of grid visual elements. Using the object, you can define the style settings, for instance, of row headers and content, the style settings of category rows, the background and selection, inactive rows and other elements.

Style modifications made are common for all the corresponding grid elements. For instance, changing the style of the grid rows’ content affects the content’s look and feel for all the rows within the control. You can override these global settings by redefining the style settings for individual row levels.


TcxVerticalGridStyles Hierarchy
Hierarchy

TInterfacedPersistent

     |

TcxInterfacedPersistent

     |

TcxCustomStyles

     |

TcxStyles

     |

TcxCustomControlStyles

     |


Properties for TcxVerticalGridStyles
TcxVerticalGridStyles Properties

TcxVerticalGridStyles          Legend

In TcxVerticalGridStyles

Background

Category

Content

Header

Inactive

IncSearch

Selection

StyleSheet


Events for TcxVerticalGridStyles
TcxVerticalGridStyles Events

TcxVerticalGridStyles          Legend

In TcxVerticalGridStyles

OnGetCategoryStyle

OnGetContentStyle

OnGetHeaderStyle


TcxVerticalGridStyles.Background

TcxVerticalGridStyles

Defines the style settings of the vertical grid’s background.

property Background;

Description

Use the Background property to define the style settings of the vertical grid’s background.


TcxVerticalGridStyles.Category

TcxVerticalGridStyles

Defines the style settings of category rows.

property Category: TcxStyle;

Description

Use the Category property to define the style settings of all the category rows within the control.


TcxVerticalGridStyles.Content

TcxVerticalGridStyles

Defines the style settings of the rows’ contents.

property Content;

Description

Use the Content property to define the style settings of row’s contents.


TcxVerticalGridStyles.Header

TcxVerticalGridStyles

Defines the style settings of row headers.

property Header: TcxStyle;

Description

Use the Header property to define the style of all row headers.


TcxVerticalGridStyles.Inactive

TcxVerticalGridStyles

Defines the style settings applied to inactive row headers.

property Inactive;

Description

Use the Inactive property to define the style of inactive row headers. When focus leaves the vertical grid control, the focused row appears inactive.


TcxVerticalGridStyles.IncSearch

TcxVerticalGridStyles

Defines the incremental search item’s style settings.

property IncSearch: TcxStyle;

Description

Use the IncSearch property to define the style settings applied to grid rows focused by the incremental search engine.


TcxVerticalGridStyles.Selection

TcxVerticalGridStyles

Defines the selected row’s header style settings.

property Selection;

Description

Use the Selection property to define the style settings of the selected row’s headers.


TcxVerticalGridStyles.StyleSheet

TcxVerticalGridStyles          See Also

Represents the style collection assigned to the control.

property StyleSheet;

Description

The StyleSheet property exposes the TcxCustomStyleSheet object whose interface can be used to add, remove and access individual styles within the collection.


TcxVerticalGridStyles.OnGetCategoryStyle

TcxVerticalGridStyles          See Also

Allows you to define the style settings of category rows.

type

  TcxvgOnGetItemStyleEvent = procedure(Sender: TObject; ARow: TcxCustomRow; var AStyle: TcxStyle) of object;

property OnGetCategoryStyle: TcxvgOnGetItemStyleEvent;

Description

The OnGetCategoryStyle event fires when painting a category row, thus allowing you to redefine the style settings of category rows.

The Sender parameter represents the vertical grid control that initiated the event.

The ARow parameter returns the category row affected.

The AStyle parameter represents the style to be applied to the current category row (returned via the ARow parameter). Note: you must assign an existing TcxStyle object to the AStyle parameter before using it.

Additionally, you can redefine the style settings of a particular row cell or header by handling the OnGetContentStyle and OnGetHeaderStyle events.


TcxVerticalGridStyles.OnGetContentStyle

TcxVerticalGridStyles          See Also

Allows you to redefine the style settings of a row cell.

type

  TcxvgOnGetContentStyleEvent = procedure(Sender: TObject; AEditProp: TcxCustomEditorRowProperties; AFocused: Boolean; ARecordIndex: Integer; var AStyle: TcxStyle) of object;

property OnGetContentStyle: TcxvgOnGetContentStyleEvent;

Description

The OnGetContentStyle event fires when painting row cells. You can handle this event to redefine the style settings of a particular row cell.

The Sender parameter specifies the vertical grid control that initiated the event.

The AEditProp parameter exposes the TcxCustomEditorRowProperties object whose interface provides information about the editor row.

The AFocused parameter specifies whether the current row cell is focused.

The ARecordIndex parameter returns the index of the corresponding record within the data controller. The parameter returns 0 for unbound grids (i.e. TcxVerticalGrid class).

The AStyle parameter represents the style to be applied to the current row cell. Note: you must assign an existing TcxStyle object to the AStyle parameter before using it.

Additionally, you can redefine the style settings of an individual category row and a particular row’s header by handling the OnGetCategoryStyle and OnGetHeaderStyle events respectively.


TcxVerticalGridStyles.OnGetHeaderStyle

TcxVerticalGridStyles          See Also

Allows you to redefine the style settings of a row’s header.

type

  TcxvgOnGetItemStyleEvent = procedure(Sender: TObject; ARow: TcxCustomRow; var AStyle: TcxStyle) of object;

property OnGetHeaderStyle: TcxvgOnGetItemStyleEvent;

Description

The OnGetHeaderStyle event fires when painting row headers, thus allowing you to redefine the style settings of the header of an individual row.

The Sender parameter returns the vertical grid control that initiated the event.

The ARow parameter returns the grid row affected.

The AStyle parameter represents the style to be applied to the current row header. Note: you must assign an existing TcxStyle object to the AStyle parameter before using it.

Additionally, you can redefine the style settings of an individual category row and a particular row cell’s content by handling the OnGetCategoryStyle and OnGetContentStyle events respectively.


TcxVerticalGridRows
TcxVerticalGridRows Object

Hierarchy          Properties          Methods

Represents the rows collection of a vertical grid control.

Unit

cxVGrid

TcxVerticalGridRows = class(TObject)

Description

The vertical grid control owns a collection of rows.  This collection can be accessed via the VerticalGrid.Rows property.  This property represents an instance of the TcxVerticalGridRows class.


TcxVerticalGridRows Hierarchy
Hierarchy

TObject

     |


Properties for TcxVerticalGridRows
TcxVerticalGridRows Properties

TcxVerticalGridRows          Legend

In TcxVerticalGridRows

Count

Items


Methods for TcxVerticalGridRows
TcxVerticalGridRows Methods

TcxVerticalGridRows          Legend

In TcxVerticalGridRows

AssignRows

IndexOf


TcxVerticalGridRows.Count

TcxVerticalGridRows

Returns the total number of rows within the vertical grid control.

property Count: Integer;

Description

Use the Count property value to obtain the number of rows.  Use the Items property to access vertical grid rows.

ReadOnly Property


TcxVerticalGridRows.Items

TcxVerticalGridRows

Provides indexed access to the rows within the vertical grid.

property Items[Index: Integer]: TcxCustomRow;

Description

Use the Items property to access vertical grid rows via their AbsoluteIndex property value.  This property allows the addressing of rows according to their actual position within the vertical grid control.

Note: this property returns TcxCustomRow instances.  A type cast needs to be performed before operating with the row obtained.


TcxVerticalGridRows.AssignRows

TcxVerticalGridRows

Copies one row collection to another.

procedure AssignRows(Source: TcxVerticalGridRows);

Description

Use the AssignRows method to copy one row collection to another.  This method copies the complete rows structure, i.e. all parent rows and their children.


TcxVerticalGridRows.IndexOf

TcxVerticalGridRows

Returns the index of the specified row.

function IndexOf(ARow: TcxCustomRow): Integer;

Description

Use the IndexOf method to obtain the index of the specified row.  The index returned is the row’s AbsoluteIndex property value.


TcxvgHitTest
TcxvgHitTest Object

Hierarchy          Properties

Contains information about the vertical grid visual element currently located under the mouse cursor.

Unit

cxVGrid

TcxvgHitTest = class(TcxCustomHitTestController);

Description

The TcxvgHitTest object is exposed via the HitTest property and provides an interface that allows you to determine the vertical grid visual element located under mouse cursor.


TcxvgHitTest Hierarchy
Hierarchy

TcxCustomHitTestController

     |


Properties for TcxvgHitTest
TcxvgHitTest Properties

TcxvgHitTest          Legend

In TcxvgHitTest

HitAtBandSizing

HitAtButton

HitAtCaption

HitAtCustomize

HitAtDivider

HitAtEmpty

HitAtImage

HitAtIndent

HitAtRowHeader

HitAtRowSizing

HitAtValue

HitBandIndex

HitCellIndex

HitRow


TcxvgHitTest.HitAtBandSizing

TcxvgHitTest          See Also

Indicates that mouse pointer is over a band’s sizing line.

property HitAtBandSizing: Boolean;

Description

Read the HitAtBandSizing property to determine whether mouse pointer is over a band’s sizing line.

Note that the property can only be used when the vertical grid is displayed in banded view (see LayoutStyle).

ReadOnly Property


TcxvgHitTest.HitAtButton

TcxvgHitTest

Indicates that mouse pointer is over an expand button.

property HitAtButton: Boolean;

Description

Read the HitAtButton property to determine whether mouse pointer is over an expand button.

ReadOnly Property


TcxvgHitTest.HitAtCaption

TcxvgHitTest

Indicates that mouse cursor is over a row’s caption.

property HitAtCaption: Boolean;

Description

Read the HitAtCaption property to determine whether mouse cursor is over a row’s caption.

ReadOnly Property


TcxvgHitTest.HitAtCustomize

TcxvgHitTest          See Also

Indicates that mouse cursor is over the customization box.

property HitAtCustomize: Boolean;

Description

Read the HitAtCustomize property to determine whether mouse cursor is over the customization box.

Note:	the property only returns True during drag and drop operations, i.e. when the end user drags a header into the customization box (see Customizing).

ReadOnly Property


TcxvgHitTest.HitAtDivider

TcxvgHitTest

Indicates that mouse cursor is over the divider.

property HitAtDivider: Boolean;

Description

Read the HitAtDivider property to determine whether mouse cursor is over the divider. The divider represents a line dividing row headers from row values.

ReadOnly Property


TcxvgHitTest.HitAtEmpty

TcxvgHitTest

Indicates that mouse cursor is over the grid’s empty space.

property HitAtEmpty: Boolean;

Description

Read the HitAtEmpty property to determine whether mouse cursor is over the vertical grid’s empty space. Empty space is defined as the area available for, but not occupied by rows.

ReadOnly Property


TcxvgHitTest.HitAtImage

TcxvgHitTest

Indicates that mouse cursor is over an image.

property HitAtImage: Boolean;

Description

Read the HitAtImage property to determine whether mouse cursor is over an image.

ReadOnly Property


TcxvgHitTest.HitAtIndent

TcxvgHitTest

Indicates that mouse cursor is over an indent space.

property HitAtIndent: Boolean;

Description

Read the HitAtIndent property to determine whether mouse cursor is over an indent space.

ReadOnly Property


TcxvgHitTest.HitAtRowHeader

TcxvgHitTest

Indicates that mouse cursor is over a row’s header.

property HitAtRowHeader: Boolean;

Description

Read the HitAtRowHeader property to determine whether mouse cursor is over a row’s header.

Additionally, you can use the HitAtCaption property to determine whether the mouse cursor is over a row’s caption.

ReadOnly Property


TcxvgHitTest.HitAtRowSizing

TcxvgHitTest          See Also

Indicates that the mouse cursor is over a row’s bottom line.

property HitAtRowSizing: Boolean;

Description

Read the HitAtRowSizing property to determine whether mouse cursor is over a row’s bottom line. A row’s bottom line can be used to vertically resize the row. To resize a grid row vertically, the end user should drag the row’s bottom line to determine the new size of the row. Note: the RowSizing option should be enabled to allow this. If the option is disabled, the HitAtRowSizing property always returns False.

ReadOnly Property


TcxvgHitTest.HitAtValue

TcxvgHitTest

Indicates that mouse cursor is over a row’s value.

property HitAtValue: Boolean;

Description

Read the HitAtValue property to determine whether mouse cursor is over a row’s cell.

Additionally, you can determine whether mouse cursor is over a row’s caption using the HitAtCaption property.

ReadOnly Property


TcxvgHitTest.HitBandIndex

TcxvgHitTest

Returns the index of the grid band that the mouse cursor is currently over.

property HitBandIndex: Integer;

Description

Read the HitBandIndex property to determine the index of the grid band that the mouse cursor is currently over. Note that if the LayoutStyle property is set to ulsSingleRecordView, the property always returns 0.

ReadOnly Property


TcxvgHitTest.HitCellIndex

TcxvgHitTest

Returns the index of the row’s cell that the mouse cursor is over.

property HitCellIndex: Integer;

Description

Read the HitCellIndex property to determine the index of the row’s cell under the cursor. The property is useful when working with multieditor rows (see TcxCustomMultiEditorRow). For simple editor rows (see TcxCustomRow), the property returns 0.

Additionally, you can obtain the row under the mouse cursor using the HitRow property.

ReadOnly Property


TcxvgHitTest.HitRow

TcxvgHitTest

Returns the grid row under the cursor.

property HitRow: TcxCustomRow;

Description

Use the HitRow property to obtain the grid row that the mouse cursor is over.

ReadOnly Property


TcxvgGridLines
TcxvgGridLines type

Enumerates the available grid lines.

Unit

cxVGrid

type

  TcxvgGridLines = (vglNone, vglHorizontal, vglVertical, vglBoth);

Description

The TcxvgGridLines enumerator is used by the GridLines property that allows you to specify which lines the vertical grid control should display.

Value	Meaning
vglNone	The vertical grid does not display any lines.
vglHorizontal	The vertical grid only displays horizontal lines.
vglVertical	The vertical grid only displays vertical lines.
vglBoth	Vertical and horizontal lines are displayed.


TcxvgLayoutStyle
TcxvgLayoutStyle type

Enumerates the available layout styles.

Unit

cxVGrid

type

  TcxvgLayoutStyle = (lsBandsView, lsSingleRecordView, lsMultiRecordView);

Description

The TcxvgLayoutStyle enumerator is used by the LayoutStyle property that allows you to specify the vertical grid control’s layout style.

Value	Meaning	Image
lsBandsView	The grid displays its data in bands.
lsSingleRecordView	The grid displays a single record.
lsMultiRecordView	The grid is able to display several records.

This enumerator is used to specify the layout style of the Virtual and DB vertical grids. The Unbound grid uses the TcxvgUnboundLayoutStyle enumerator.


TcxvgPaintStyle
TcxvgPaintStyle type

Enumerates the available painting styles of the vertical grid control.

Unit

cxVGrid

type

  TcxvgPaintStyle = (psdotNet, psDelphi);

Description

The TcxvgPaintStyle is used by the PaintStyle option that allows you to specify the painting style of the vertical grid control.

Value	Meaning
psdotNet	The grid is painted in .NET style.
psDelphi	The grid is painted in Delphi style.
The following image demonstrates a vertical grid control in psDelphi and psdotNet paint style respectively:


TcxvgUnboundLayoutStyle
TcxvgUnboundLayoutStyle type

Enumerates the available layout styles of an unbound vertical grid.

Unit

cxVGrid

type

  TcxvgUnboundLayoutStyle = (ulsBandsView, ulsSingleRecordView);

Description

The TcxvgUnboundLayoutStyle is used by the LayoutStyle option of an Unbound vertical grid.

Value	Meaning	Image
ulsBandsView	The Unbound vertical grid presents its data via bands.
ulsSingleRecordView	The Unbound vertical grid presents its data in the single-record-by-page manner.

For Virtual and DB vertical grids, the TcxvgLayoutStyle enumerator is used.


TSeparatorKind
TSeparatorKind type

Enumerates the available kinds of grid separators.

Unit

cxVGrid

type

  TSeparatorKind = (skVertLine, skString);

Description

The TSeparatorKind is used by the SeparatorKind option that allows you to specify the separator kind used to split a multieditor row’s values. When the SeparatorKind option is set to skString, you should specify the string separator via the SeparatorString property.

Value	Meaning	Image
skVertLine	The grid uses vertical lines to separate multieditor rows’ cell values.
skString	The grid uses a string to separate values within multieditor rows. The separator string is determined via the SeparatorString property.


cxVGridConsts Unit Overview
cxVGridConsts Unit

Resource Strings

cxSvgAssignRowsError  'Can''t assign rows'

cxSvgCancelCaption  'Cancel'

cxSvgCustomizeCaption  'Customize'

cxSvgCustomizeCategoriesCaption  'Categories'

cxSvgCustomizeDeleteCategory  '&Delete'

cxSvgCustomizeNewCategory  '&New...'

cxSvgCustomizeRowsCaption  'Rows'

cxSvgDeletingConfirmationCaption  'Confirm'

cxSvgDeletingFocusedConfirmationText  'Delete record?'

cxSvgExportNotVisibleControl  'Can''t export invisible control'

cxSvgIndexError  'Index error'

cxSvgInvalidRowClass  'Can''t create row'

cxSvgLayoutEditorCaption  'Layout editor'

cxSvgLayoutEditorCustomize  '&Customize'

cxSvgNewCategoryCaption  'New Category'

cxSvgNewCategoryLabelCaption  '&Category:'

cxSvgOKCaption  'OK'

cxSvgRTTIInspectorEmptyGlyph  '(None)'

cxSvgUnknown  '(Unknown)'


TcxvgMultiRecordsOptionsView
TcxvgMultiRecordsOptionsView Object

Hierarchy          Properties

Represents settings for customizing the grid control appearance in the multiple record layout.

Unit

cxVGrid

TcxvgMultiRecordsOptionsView = class(TcxvgOptionsView)

Description

The TcxvgMultiRecordsOptionsView class represents settings for customizing the grid control appearance in the multiple record layout. This layout is defined when the value of the property TcxVirtualVerticalGrid.LayoutStyle is lsMultiRecordView.


TcxvgMultiRecordsOptionsView Hierarchy
Hierarchy

TPersistent

     |

TcxOwnedPersistent

     |

TcxControlOptionsView

     |

TcxvgOptionsView

     |


Properties for TcxvgMultiRecordsOptionsView
TcxvgMultiRecordsOptionsView Properties

TcxvgMultiRecordsOptionsView          Legend

In TcxvgMultiRecordsOptionsView

RecordsInterval

Derived from TcxvgOptionsView

AutoScaleBands

BandsInterval

CategoryExplorerStyle

GridLineColor

GridLines

PaintStyle

RowHeaderMinWidth

RowHeaderWidth

RowHeight

ShowButtons

ShowEmptyRowImage

ShowHeaders

ValueMinWidth

ValueWidth

Derived from TcxControlOptionsView

CellAutoHeight

CellEndEllipsis

CellTextMaxLineCount

ScrollBars

ShowEditButtons


TcxvgMultiRecordsOptionsView.RecordsInterval

TcxvgMultiRecordsOptionsView

Specifies spacing between data columns in pixels.

property RecordsInterval: Integer;

Description

Use the RecordsInterval to set the amount of space in pixels between data columns.

The default value of the RecordsInterval property is 0.


TcxvgOptionsBehavior
TcxvgOptionsBehavior Object

Hierarchy          Properties

Contains settings determining the grid control response to user actions.

Unit

cxVGrid

TcxvgOptionsBehavior = class(TcxControlOptionsBehavior)

Description

The TcxvgOptionsBehavior object contains settings determining the grid control response to the user actions. These options determine whether the cell editors are always active and whether row/band resizing or row tracking are available.

Use the TcxCustomVerticalGrid.OptionsBehavior property to access this set of options.


TcxvgOptionsBehavior Hierarchy
Hierarchy

TcxControlOptionsBehavior

     |


Properties for TcxvgOptionsBehavior
TcxvgOptionsBehavior Properties

TcxvgOptionsBehavior          Legend

In TcxvgOptionsBehavior

AlwaysShowEditor

BandSizing

HeaderSizing

RowSizing

RowTracking


TcxvgOptionsBehavior.AlwaysShowEditor

TcxvgOptionsBehavior

Specifies whether the cell editors are always active.

property AlwaysShowEditor: Boolean;

Description

Set the AlwaysShowEditor property to True to make the cell editors always active. This means that the user does not have to press the Enter or F2 key to enable editing for cell content when focus is set to the current cell.


TcxvgOptionsBehavior.BandSizing

TcxvgOptionsBehavior          See Also

Specifies the band resizing availability.

property BandSizing: Boolean;

Description

When in a band view layout (the value of the TcxVirtualVerticalGrid.LayoutStyle property is lsBandsView) if the band doesn’t occupy all the width of the grid control’s client area (the value of the TcxvgOptionsView.AutoScaleBands property is False) the BandSizing property specifies whether the user can change the band’s width.

If the value of the BandSizing is True the user can drag the right edge of the band to resize the band’s width.

Note: if the value of the TcxVirtualVerticalGrid.LayoutStyle property is lsMultiRecordView and the value of the BandSizing property is True the user can drag the right edge of the first data column to resize the width of all data columns in the grid. The user cannot resize the data columns width less than specified by the TcxvgOptionsView.ValueMinWidth property.

The default value of the BandSizing property is True.


TcxvgOptionsBehavior.HeaderSizing

TcxvgOptionsBehavior

Specifies row headers resizing availability.

property HeaderSizing: Boolean;

Description

The HeaderSizing property specifies whether the user can change row headers width.

If the value of the HeaderSizing is True the user can drag the right edge of the header column to resize row header column width.

The default value of the HeaderSizing property is True.


TcxvgOptionsBehavior.RowSizing

TcxvgOptionsBehavior          See Also

The RowSizing property specifies whether the user can change the row height.

property RowSizing: Boolean;

Description

If the value of the RowSizing is True the user can drag the bottom edge of any row in the grid control to resize the desired row height.

The default value of the RowSizing property is False.


TcxvgOptionsBehavior.RowTracking

TcxvgOptionsBehavior

Enables row tracking when the user moves the mouse pointer over rows while pressing left mouse button.

property RowTracking: Boolean;

Description

Enables changing of the current row appearance and the item editor activation when the user moves the mouse pointer over rows while pressing left mouse button as shown in the image below:

Row tracking can be performed if the value of this property is set to True.  If the value of the RowTracking property is False just the first row that the user clicks on when starts moving the mouse pointer changes its appearance while the others retain their state.

The default value of the RowTracking property is True.


TcxvgOptionsView
TcxvgOptionsView Object

Hierarchy          Properties

Contains settings for customizing appearance of the grid control.

Unit

cxVGrid

TcxvgOptionsView = class(TcxControlOptionsView)

Description

The properties of the TcxvgOptionsView object specify the grid control appearance options that control bands’ layout, expand buttons visibility, grid lines, header cells and data cells appearance, etc.

The following image demonstrates the TcxvgOptionsView settings in the Object Inspector:

Use the TcxCustomVerticalGrid.OptionsView property to access this set of options.


TcxvgOptionsView Hierarchy
Hierarchy

TPersistent

     |

TcxOwnedPersistent

     |

TcxControlOptionsView

     |


Properties for TcxvgOptionsView
TcxvgOptionsView Properties

TcxvgOptionsView          Legend

In TcxvgOptionsView

AutoScaleBands

BandsInterval

CategoryExplorerStyle

GridLineColor

GridLines

PaintStyle

RowHeaderMinWidth

RowHeaderWidth

RowHeight

ShowButtons

ShowEditButtons

ShowEmptyRowImage

ShowHeaders

ValueMinWidth

ValueWidth

Derived from TcxControlOptionsView

CellAutoHeight

CellEndEllipsis

CellTextMaxLineCount

ScrollBars

ShowEditButtons


TcxvgOptionsView.AutoScaleBands

TcxvgOptionsView

Specifies if the band fills the width of all client area of the grid control.

property AutoScaleBands: Boolean;

Description

When working in a band view layout (the value of the TcxVirtualVerticalGrid.LayoutStyle property is lsBandsView) this property specifies the band width adjusting within the grid control. If the value of this property is True the grid control automatically adjusts the band’s width to the width of the control client area.

The default value of the AutoScaleBands property is True.


TcxvgOptionsView.BandsInterval

TcxvgOptionsView          See Also

Specifies spacing between bands.

property BandsInterval: Integer;

Description

Use the BandsInterval to set the amount of space in pixels between bands.

The default value of the BandsInterval property is 2.


TcxvgOptionsView.CategoryExplorerStyle

TcxvgOptionsView

Determines whether to use Windows XP paint style.

property CategoryExplorerStyle: Boolean;

Description

When the value of the CategoryExplorerStyle is True the category rows are drawn in XP paint style if the user uses Windows XP.

Otherwise they have tree-like view style.

The default value of the CategoryExplorerStyle property is False.


TcxvgOptionsView.GridLineColor

TcxvgOptionsView

Specifies the color of the lines that separate the cells in the grid control.

property GridLineColor: TColor;

Description

Set the GridLineColor to specify the color of the lines drawn between the cells of the grid control. The grid lines appear when the GridLines property is not set to vglNone.

The default value of the GridLineColor property is specified by the PaintStyle property default value psDotNet.


TcxvgOptionsView.GridLines

TcxvgOptionsView

Specifies whether grid lines are visible.

type

  TcxvgGridLines = (vglNone, vglHorizontal, vglVertical, vglBoth);

property GridLines: TcxvgGridLines;

Description

The GridLines property determines what grid lines are displayed in the grid control.

The possible values are:

Value	Meaning
glBoth	Horizontal and vertical grid lines are visible
glHorizontal	Only horizontal grid lines are visible
glNone	There are no grid lines
glVertical	Only vertical grid lines are visible

Use the GridLineColor property to specify the color of the lines.

The default value of the GridLines property is vglBoth.


TcxvgOptionsView.PaintStyle

TcxvgOptionsView

Specifies the painting style of the grid control.

type

  TcxvgPaintStyle = (psdotNet, psDelphi);

property PaintStyle: TcxvgPaintStyle;

Description

Use the PaintStyle property to determine what style the grid control is drawn in.

The possible values are:

Value	Meaning	Picture
psdotNet	.NET painting style
psDelphi	Delphi painting style

The default value of the PaintStyle property is psDotNet.


TcxvgOptionsView.RowHeaderMinWidth

TcxvgOptionsView          See Also

Specifies the minimum width of row headers in pixels.

property RowHeaderMinWidth: Integer;

Description

Use the RowHeaderMinWidth property to specify the minimum width of row headers in pixels. It prevents from resizing of width of row headers by the user less than determined by the RowHeaderMinWidth. The user can resize the width of row headers if the value of the TcxvgOptionsBehavior.HeaderSizing is True.

If you try to assign in runtime the RowHeaderWidth property value less than specified by the RowHeaderMinWidth property the value of the RowHeaderMinWidth property will be assigned.

The default value of the RowHeaderMinWidth property is 24.


TcxvgOptionsView.RowHeaderWidth

TcxvgOptionsView          See Also

Specifies the width of row headers in pixels.

property RowHeaderWidth: Integer;

Description

Use the RowHeaderWidth property to specify the width of row headers.  If this value is insufficient to display captions entirely then text clipping may occur.

If you try to assign the RowHeaderWidth property value at runtime less than specified by the RowHeaderMinWidth property the value of the RowHeaderMinWidth property will be assigned. The maximum value you can assign to the RowHeaderWidth property is limited by the width of the vertical grid client area minus the ValueMinWidth property value.

The default value of the RowHeaderWidth property is 100.


TcxvgOptionsView.RowHeight

TcxvgOptionsView          See Also

Specifies the height of the row in pixels.

property RowHeight: Integer;

Description

Use the RowHeight property to set the height of the row in pixels. A value of -1 indicates that the height of the row depends on default settings (see Font, Styles, TcxVerticalGridStyles.Header, TcxVerticalGridStyles.Content, TcxCustomRow.Styles). Any way you cannot set the row height less than specified by the Font property. The RowHeight property differs from the TcxCustomRow.Height property in that the RowHeight affects all rows in the grid control. The TcxCustomRow.Height property has priority over the RowHeight property.

Note: if the value of the TcxRowOptions.CanAutoHeight is True or the value of the CellAutoHeight property is True row(s) automatically change height to accommodate their content without clipping. If the value of the TcxRowOptions.CanResized or TcxvgOptionsBehavior.RowSizing is True the user can resize the row(s) height by dragging the bottom edge of the desired row.

The default value of the RowHeight property is -1.


TcxvgOptionsView.ShowButtons

TcxvgOptionsView

Specifies whether to display expand buttons of the parent rows.

property ShowButtons: Boolean;

Description

If the value of ShowButtons is True and the value of the TcxRowOptions.ShowExpandButton property is True an expand button will appear on each parent row. The user can click the button to expand or collapse the parent row as an alternative to double-clicking the parent row.

If the value of ShowButtons is False expand buttons are unavailable and the user can expand or collapse the parent row by double-clicking the parent row only (if the value of the TcxRowOptions.ShowExpandButton property is True).

The default value of the ShowButtons property is True.


TcxvgOptionsView.ShowEditButtons

TcxvgOptionsView

Specifies the manner in which editors are displayed within cells.

type

  TcxEditingControlEditShowButtons = (ecsbAlways, ecsbFocused, ecsbNever);

property ShowEditButtons;

Description

If an in-place cell editor has buttons, you can enable their display for a focused cell or for all item cells.  Set the ShowEditButtons property to the appropriate value to specify the manner in which editor buttons are displayed within the control.

There are three settings available:

Value	Meaning
ecsbAlways	Editor buttons are always visible.
ecsbFocused	The TcxVirtualVerticalGrid.LayoutStyle property’s value is lsMultiRecordView – editor buttons are only visible for cells within the focused record. The TcxVirtualVerticalGrid.LayoutStyle property’s value is lsSingleRecordView or lsBandsView – editor buttons are only visible in the focused cell.
ecsbNever	Editor buttons are not displayed.

The default value of the ShowEditButtons property is ecsbNever.


TcxvgOptionsView.ShowEmptyRowImage

TcxvgOptionsView

Specifies whether the text in row header cells will be indented.

property ShowEmptyRowImage: Boolean;

Description

Rows can display header images if the TcxCustomVerticalGrid.Images property is set to the TImageList instance.

If the value of the TcxCaptionRowProperties.ImageIndex property of the specified row is set to –1 this row will not display image in its header. In this case it’s possible to align header text in this row at the value of image width.

If the value of the ShowEmptyRowImage is True the header text will be indented to the right at the value of image width.

Otherwise no spacing will occur.

The default value of the ShowEmptyRowImage property is False.


TcxvgOptionsView.ShowHeaders

TcxvgOptionsView

Specifies whether to display row headers.

property ShowHeaders: Boolean;

Description

If the value of the ShowHeaders is True row header column will appear in the grid control. Otherwise only data columns will be shown.

The default value of the ShowHeaders property is True.


TcxvgOptionsView.ValueMinWidth

TcxvgOptionsView          See Also

Specifies the minimum width of data cells in pixels.

property ValueMinWidth: Integer;

Description

Use the ValueMinWidth property to specify the minimum width of data cells in pixels. If the value of the TcxvgOptionsBehavior.BandSizing property is True and the value of the TcxVirtualVerticalGrid.LayoutStyle property is lsMultiRecordView the user can drag the right edge of the first data column to resize the width of all data columns in the grid.  In this case the user couldn’t resize the data columns less than specified by the ValueMinWidth.

If you attempt to assign the ValueWidth property value less than specified by the ValueMinWidth property the value of the ValueMinWidth property will be assigned.

The default value of the ValueMinWidth property is 40.


TcxvgOptionsView.ValueWidth

TcxvgOptionsView          See Also

Specifies the width of data cells in pixels.

property ValueWidth: Integer;

Description

Use the ValueWidth property to specify the width of data cells in pixels. This property affects the data cell width if the value of the TcxVirtualVerticalGrid.LayoutStyle

property is lsBandsView or lsMultiRecordView and the value of the TcxvgOptionsView.AutoScaleBands property is False. If this value is insufficient to display data in cells entirely then text clipping may occur.

If the value of the TcxvgOptionsBehavior.BandSizing property is True and the value of the TcxVirtualVerticalGrid.LayoutStyle property is lsMultiRecordView the user can drag the right edge of the first data column to resize the width of all data columns in the grid.

If you attempt to assign the ValueWidth property value less than specified by the ValueMinWidth property the value of the ValueMinWidth property will be assigned.

If the value of the AutoScale property is True and the value of the TcxVirtualVerticalGrid.LayoutStyle

property is lsBandsView the grid control automatically adjusts the band’s width to the width of the control client area. In this case the value of the ValueWidth property is ignored. If the value of the ShowHeaders property is False the grid control automatically enlarge the band’s width to fit the width of the control client area. In this case the value of the ValueWidth property is ignored.

If the value of the TcxVirtualVerticalGrid.LayoutStyle

property is lsSingleRecordView the grid control automatically adjusts the data column width to the width of the control client area. In this case the value of the ValueWidth property is ignored. If the value of the ShowHeaders property is False the grid control automatically enlarge the data column width to fit the width of the control client area. In this case the value of the ValueWidth property is ignored.

The default value of the ValueWidth property is 100.


TcxRowOptions
TcxRowOptions Object

Hierarchy          Properties

Contains settings for customizing row behavior.

Unit

cxVGrid

TcxRowOptions = class(TPersistent)

Description

The properties of the TcxRowOptions class specify the row behavior options. These settings specify if the row can change its height automatically to accommodate its content, whether the user can change the row height, if the row can be moved to or shown in the Customization Form, etc.

Use the TcxCustomRow.Options property to access this set of options.


TcxRowOptions Hierarchy
Hierarchy

TPersistent

     |


Properties for TcxRowOptions
TcxRowOptions Properties

TcxRowOptions          Legend

In TcxRowOptions

CanAutoHeight

CanMovedToCustomizationForm

CanResized

Focusing

Moving

ShowExpandButton

ShowInCustomizationForm


TcxRowOptions.CanAutoHeight

TcxRowOptions

Specifies whether to adjust the row height to show all the text in a cell.

property CanAutoHeight: Boolean;

Description

If the value of CanAutoHeight is True the row height is automatically adjusted to entirely display the cell contents. If the text doesn’t fit inside the bounds of cells word wrapping is occurred.

Note that the number of lines is limited by the value of the TcxControlOptionsBehavior.CellTextMaxLineCount property.

The CanAutoHeight property is ignored if the value of the TcxVirtualVerticalGrid.LayoutStyle is IsBandsView and the value of the TcxvgOptionsView.AutoScaleBands is True.

The default value of the CanAutoHeight property is True.


TcxRowOptions.CanMovedToCustomizationForm

TcxRowOptions          See Also

Specifies whether the current row can be moved to the Customization Form.

property CanMovedToCustomizationForm: Boolean;

Description

If the value of the CanMovedToCustomizationForm property is True the user can move the desired row to the Customization Form. It could be done by dragging the row header onto the Customization Form.

The default value of the CanMovedToCustomizationForm property is True.


TcxRowOptions.CanResized

TcxRowOptions          See Also

Specifies whether the user can change the height of specified row.

property CanResized: Boolean;

Description

If the value of CanResized is True the user can drag the bottom edge of specified row in the grid control to resize this row.

The CanResized property overrides state for the specified row that was set by the TcxvgOptionsBehavior.RowSizing property.

The default value of the CanResized property is True.


TcxRowOptions.Focusing

TcxRowOptions

Specifies whether the specified row gets focus when the user navigates through rows using mouse or keyboard.

property Focusing: Boolean;

Description

If the value of the Focusing is True the user can set focus on the specified row. Otherwise it’s impossible to edit row content.

The default value of the Focusing property is True.


TcxRowOptions.Moving

TcxRowOptions          See Also

Specifies whether the user can move rows within the grid control using drag and drop operation.

property Moving: Boolean;

Description

If the Moving property is set to True the user can move the given row by dragging its header’s caption area within the control. Otherwise it’s impossible to move rows within the grid control.

Note: when the Moving property is set to True the user can move rows within the grid control without using the Customization Form.

The default value of the Moving property is True.


TcxRowOptions.ShowExpandButton

TcxRowOptions          See Also

Specifies whether to display an expand button on the row if this row is parent.

property ShowExpandButton: Boolean;

Description

Specifies whether to display an expand button on the row if this row is parent. If the value of the ShowExpandButton property is False the expand button is not shown and such user’s actions as expanding or collapsing are unavailable.

If the value of the TcxCustomRow.Expanded property is False the parent row is collapsed and the user cannot expand the parent row. If the value of the TcxCustomRow.Expanded property is True the parent row is expanded and the user cannot collapse the parent row.

The default value of the ShowExpandButton property is True.


TcxRowOptions.ShowInCustomizationForm

TcxRowOptions          See Also

Specifies if the current row can be shown in the Customization Form.

property ShowInCustomizationForm: Boolean;

Description

When working with the Customization Form the user can rearrange rows by dragging them to/from the Customization Form or within the grid control.

If the value of the ShowInCustomizationForm property is False the current row is not displayed in the Customization Form. So the user could not rearrange this row among other rows in the Customization Form when he/she dropped this row in the Customization Form.

It could be done only within the grid control when the layout customization session is activated (see TcxVerticalGridCustomizing.Visible).

The default value of the ShowInCustomizationForm property is True.


TcxEditorRowPropertiesOptions
TcxEditorRowPropertiesOptions Object

Hierarchy          Properties

Contains settings that enable/disable some user actions with the row.

Unit

cxVGrid

TcxEditorRowPropertiesOptions = class(TcxCustomEditContainerItemOptions)

Description

The TcxEditorRowPropertiesOptions object properties determine whether operations like editing of data cells content, setting the focus on the desired row, etc. are available.

The TcxEditorRowPropertiesOptions publishes properties inherited from its ancestor but introduces no new behavior.


TcxEditorRowPropertiesOptions Hierarchy
Hierarchy

TcxCustomEditContainerItemOptions

     |


Properties for TcxEditorRowPropertiesOptions
TcxEditorRowPropertiesOptions Properties

TcxEditorRowPropertiesOptions          Legend

Derived from TcxCustomEditContainerItemOptions

Editing

Filtering

Focusing

IncSearch

ShowEditButtons

TabStop


TcxCustomRow
TcxCustomRow Object

Hierarchy          Properties          Methods

The TcxCustomRow is the base class that represents base interface structure and common functionality for rows of different types in the grid control.

Unit

cxVGrid

TcxCustomRow = class(TComponent)

Description

The TcxCustomRow introduces properties and methods to control the appearance and behavior of the row. Do not instantiate the TcxCustomRow class. Use its descendants like TcxCategoryRow, TcxEditorRow,  TcxDBEditorRow, TcxMultiEditorRow and TcxDBMultiEditorRow instead.


TcxCustomRow Hierarchy
Hierarchy

TComponent

     |


Properties for TcxCustomRow
TcxCustomRow Properties

TcxCustomRow          Legend

In TcxCustomRow

AbsoluteIndex

Count

Expanded

Height

Index

Level

Options

OwnerRows

Parent

Rows

Styles

VerticalGrid

ViewInfo

Visible

VisibleIndex


Methods for TcxCustomRow
TcxCustomRow Methods

TcxCustomRow          Legend

In TcxCustomRow

 Assign

 Changed

 Collapse

 Expand

 GetFirstVisibleChild

 GetLastVisibleChild

 HasChildren

 HasVisibleChildren

 IndexOf

 IsChild

 IsFirst

 IsFirstVisible

 IsLast

 IsLastVisible

 IsParent

 IsRootLevel

 MakeVisible

 RestoreDefaults


TcxCustomRow.AbsoluteIndex

TcxCustomRow

Determines the position of the current row in the grid control.

property AbsoluteIndex: Integer;

Description

Use the AbsoluteIndex to determine position of the current row in the grid control. It’s a zero-based index; all subsequent rows are numbered sequentially.

ReadOnly Property


TcxCustomRow.Count

TcxCustomRow

Determines the number of child rows relative to the parent row.

property Count: Integer;

Description

Read the Count to determine the number of child rows. The Count provides an upper limit to the indexes that can be used when expanding or collapsing, inserting or deleting rows. The value of the Count property is one greater than the index of the last child row.

ReadOnly Property


TcxCustomRow.Expanded

TcxCustomRow

Specifies whether the current row is expanded/collapsed.

property Expanded: Boolean;

Description

If the value of the Expanded property is True the current row is expanded. Use the Expanded to expand or collapse the row. As an alternative you can use the Expand or the Collapse methods to expand or collapse the current row. It’s reasonable to apply this

property for the parent row, that is for the row that has child rows.

The default value of the Expanded property is True.


TcxCustomRow.Height

TcxCustomRow          See Also

Specifies the height of the row in pixels.

property Height: Integer;

Description

Use the Height property to set the height of the row in pixels. A value of -1 indicates that the height of the row depends on its content. This property differs from the TcxvgOptionsView.RowHeight property in that the Height affects only specified row. This property takes priority over the TcxvgOptionsView.RowHeight property.

The default value of the Height property is -1.


TcxCustomRow.Index

TcxCustomRow

Specifies the actual position of the current row within the vertical grid control.

property Index: Integer;

Description

Use the Index property to specify or determine the actual position of the current row among rows at the top level if this row has no parent row or among siblings of its parent. It’s a zero-based index; all subsequent rows are numbered sequentially.


TcxCustomRow.Level

TcxCustomRow

Indicates nesting level of the row within the grid control.

property Level: Integer;

Description

The value of the Level is 0 for rows on the topmost level. The value of the Level is 1 for their children, and so on.

ReadOnly Property


TcxCustomRow.Options

TcxCustomRow

Represents a set of options to customize row behavior.

property Options: TcxRowOptions;

Description

Use the Options property to configure row behavior settings. These settings include resizing, focusing, height automatic adjusting, rows moving to and showing in the Customization Form.


TcxCustomRow.OwnerRows

TcxCustomRow

References the TcxVerticalGridRows object.

property OwnerRows: TcxVerticalGridRows;

Description

Use the OwnerRows property to get access to the TcxVerticalGridRows object that provides functionality to manipulate rows in the grid control.

ReadOnly Property


TcxCustomRow.Parent

TcxCustomRow

Represents the parent row of the current row in the grid control.

property Parent: TcxCustomRow;

Description

The Parent property holds a reference to the TcxCustomRow object that represents a parent of the current row. This property specifies nil value if the current row has no parent.


TcxCustomRow.Rows

TcxCustomRow

Provides indexed access to the child rows of the current row in the grid control.

property Rows[Index:Integer]: TcxCustomRow;

Description

The Rows property provides indexed access to the child rows of the current row and is commonly used in loops to look up the desired row.

ReadOnly Property


TcxCustomRow.Styles

TcxCustomRow

Represents a set of styles defining the appearance of the row.

property Styles: TcxvgCustomRowStyles;

Description

The Styles property is used to get access to the settings of the TcxvgCustomRowStyles whose properties represent painting styles of the row. The TcxvgCustomRowStyles is the base class for styles applied to different types of rows.


TcxCustomRow.VerticalGrid

TcxCustomRow

Defines the TcxCustomVerticalGrid object containing the current row.

property VerticalGrid: TcxCustomVerticalGrid;

Description

Use the VerticalGrid property to access the TcxCustomVerticalGrid object that provides methods to manipulate row in the grid control such as TcxCustomVerticalGrid.Add, TcxCustomVerticalGrid.AssignRows, TcxCustomVerticalGrid.Remove and others.


TcxCustomRow.ViewInfo

TcxCustomRow

References the TcxCustomRowViewInfo object.

property ViewInfo: TcxCustomRowViewInfo;

Description

Use the ViewInfo property to access the TcxCustomRowViewInfo object that provides the view info of the current row to render this row in the grid control.

ReadOnly Property


TcxCustomRow.Visible

TcxCustomRow          See Also

Specifies if the current row is visible in the grid control.

property Visible: Boolean;

Description

If the value of the Visible is True the specified row is visible within bounds of the grid control. It’s possible if the parent row is expanded. Assigning this property False value makes the specified row invisible.

The default value of the Visible property is True.


TcxCustomRow.VisibleIndex

TcxCustomRow          See Also

Determines the position of the current visible row in the grid control.

property VisibleIndex: Integer;

Description

The collection of items displayed in the grid control is determined by the TcxvgCustomViewInfo.VisibleRows property. The VisibleIndex determines the position of the current row in this collection.

It’s a zero-based index; all subsequent rows are numbered sequentially.

Note that if the specified row is invisible in the control this property returns –1. It may be in the following cases:

•	The value of the Visible property is False;

•	Its parent row is collapsed.

ReadOnly Property


TcxCustomRow.Assign

TcxCustomRow

Copies the values of properties of the specified row to the current row.

procedure Assign(Source: TPersistent); override;

Description

The Assign method sets values of properties from the row specified by the Source parameter. These properties control row states like visibility, expanding, height, styles, etc.

These properties are common for different types of rows. They are defined in TcxCustomRow and inherited by its descendants.


TcxCustomRow.Changed

TcxCustomRow

Notifies the grid control when the specified row is changed.

procedure Changed(ARebuild: Boolean = False); virtual;

Description
This method notifies the grid control when the specified row is changed.

The ARebuild parameter specifies whether the rows’ tree structure will be rebuilt. If the value of the ARebuild parameter is True the trees will be rebuilt.


TcxCustomRow.Collapse

TcxCustomRow         See Also

Collapses the current row.

procedure Collapse(ARecurse: Boolean);

Description

Use the Collapse method to collapse the current row.  The ARecurse parameter identifies whether all child rows are collapsed recursively.  If this parameter value is True the subtree rooted at the current row is collapsed. Otherwise child rows retain their state as it was before the current row was collapsed.


TcxCustomRow.Expand

TcxCustomRow          See Also

Expands the current row.

procedure Expand(ARecurse: Boolean);

Description

Use the Expand method to expand the current row.  The ARecurse parameter identifies whether all child rows are expanded recursively.  If this parameter value is True the subtree rooted at the current row is expanded. Otherwise child rows retain their state as it was before the current row was expanded.


TcxCustomRow.GetFirstVisibleChild

TcxCustomRow

Returns the first visible child row of the current row if this row is parent.

function GetFirstVisibleChild: TcxCustomRow;

Description

Call the GetFirstVisibleChild to access the first visible child row of the current row.

Child row is visible if the value of its Visible property is True.

If the row has no children the GetFirstVisibleChild returns nil.


TcxCustomRow.GetLastVisibleChild

TcxCustomRow

Returns the bottommost visible child row of the current row if this row is parent.

function GetLastVisibleChild: TcxCustomRow;

Description

Call the GetLastVisibleChild to access the bottommost visible child row of the current row.

Child row is visible if the value of its Visible property is True.

If the row has no children the GetLastVisibleChild returns nil.


TcxCustomRow.HasChildren

TcxCustomRow          See Also

Tests if the current row has children.

function HasChildren: Boolean;

Description

The HasChildren method returns True if the Count property is greater than 0.


TcxCustomRow.HasVisibleChildren

TcxCustomRow          See Also

Tests if the row has visible children.

function HasVisibleChildren: Boolean;

Description

The HasVisibleChildren method returns True if the Count property is greater than 0 and at least one child row is visible that is if the value of the child row’s Visible property is True. Returns False if there is no visible child row or the row has no children at all.


TcxCustomRow.IndexOf

TcxCustomRow          See Also

Returns zero-based child row index in the collection of the current row.

function IndexOf(ARow: TcxCustomRow): Integer;

Description

Returns zero-based child row index in the collection of the current row.

The ARow parameter represents the child row.

If the ARow is not child this method returns -1.


TcxCustomRow.IsChild

TcxCustomRow          See Also

Tests if the current row is a child of the row specified by the ARow.

function IsChild(ARow: TcxCustomRow): Boolean;

Description

Returns True if the current row is the child of the row specified by the ARow. It presumes that this method returns False if the current row has no parents at all.


TcxCustomRow.IsFirst

TcxCustomRow          See Also

Tests if the current row is the first row among rows at the top level if this row has no parent or among siblings of its parent.

function IsFirst: Boolean;

Description

Returns True if the current row is the first row among rows at the top level if this row has no parent or among siblings of its parent.


TcxCustomRow.IsFirstVisible

TcxCustomRow          See Also

Tests if the current row is the first visible row among rows at the top level if this row has no parent or among siblings of its parent.

function IsFirstVisible: Boolean;

Description

Returns True if the current row is the first visible row among rows at the top level if this row has no parent or among siblings of its parent.


TcxCustomRow.IsLast

TcxCustomRow          See Also

Tests if the current row is the last row among rows at the top level if this row has no parent or among siblings of its parent.

function IsLast: Boolean;

Description

Returns True if the current row is the last row among rows at the top level if this row has no parent or among siblings of its parent.


TcxCustomRow.IsLastVisible

TcxCustomRow          See Also

Tests if the current row is the last visible row among rows at the top level if this row has no parent or among siblings of its parent.

function IsLastVisible: Boolean;

Description

Returns True if the current row is the last visible row among rows at the top level if this row has no parent or among siblings of its parent.


TcxCustomRow.IsParent

TcxCustomRow

Tests if the current row is a parent of the specified row.

function IsParent(ARow: TcxCustomRow): Boolean;

Description

Returns True if the current row is a parent of a row specified by the ARow or a parent of the ARow’s parent and so on.


TcxCustomRow.IsRootLevel

TcxCustomRow

Tests if the current row is on the root hierarchy level.

function IsRootLevel: Boolean;

Description

Returns True if the current row is on the root hierarchy level in the grid control. The Level property is used to define the current row nesting level in the grid control.


TcxCustomRow.MakeVisible

TcxCustomRow

Scrolls the view in the grid control client area in order to display the current row onscreen.

procedure MakeVisible;

Description

Call the MakeVisible method to make the current row visible in the client area of the grid control. If the current row is invisible and its parents are collapsed the method expands all the current row parents and makes them visible.


TcxCustomRow.RestoreDefaults

TcxCustomRow

Restores default values of the TcxRowOptions.

procedure RestoreDefaults;

Description

This method restores default values of the TcxRowOptions. The RestoreDefaults method delegates functionality to the TcxRowOptions.RestoreDefaults method to restore default values.


TcxCustomEditorRow
TcxCustomEditorRow Object

Hierarchy          Properties          Methods

Represents the base class for editor rows in the grid control.

Unit

cxVGrid

TcxCustomEditorRow = class(TcxCustomRow)

Description

This class introduces editor row functionality (editing capabilities, data binding, styles, etc.) that is used in derived classes TcxEditorRow and TcxDBEditorRow. The TcxCustomEditorRow implements all abstract methods declared in its ancestor TcxCustomRow class.

Do not instantiate the TcxCustomEditorRow class. Use its descendants such as TcxEditorRow or TcxDBEditorRow.


TcxCustomEditorRow Hierarchy
Hierarchy

TComponent

     |

TcxCustomRow

     |


Properties for TcxCustomEditorRow
TcxCustomEditorRow Properties

TcxCustomEditorRow          Legend

In TcxCustomEditorRow

Properties

Styles

Derived from TcxCustomRow

AbsoluteIndex

Count

Expanded

Height

Index

Level

Options

OwnerRows

Parent

Rows

Styles

VerticalGrid

ViewInfo

Visible

VisibleIndex


Methods for TcxCustomEditorRow
TcxCustomEditorRow Methods

TcxCustomEditorRow          Legend

In TcxCustomEditorRow

 CreateHeaderInfo

 CreateViewInfo

Derived from TcxCustomRow

 Assign

 Changed

 Collapse

 Expand

 GetFirstVisibleChild

 GetLastVisibleChild

 HasChildren

 HasVisibleChildren

 IndexOf

 IsChild

 IsFirst

 IsFirstVisible

 IsLast

 IsLastVisible

 IsParent

 IsRootLevel

 MakeVisible

 RestoreDefaults


TcxCustomEditorRow.Properties

TcxCustomEditorRow

Represents a set of attributes to control editor row behavior.

property Properties: TcxCustomEditorRowProperties;

Description

Used to get access to the TcxCustomEditorRowProperties object. The TcxCustomEditorRowProperties class provides common for its derived classes set of attributes to control editor row behavior. To work with these attributes in the TcxCustomEditorRow derived classes published in these classes Properties properties are used.

The following TcxCustomEditorRowProperties properties published in its derived classes control editor row behavior:

•	EditProperties specifies the properties of an inplace editor used for editing the row contents;

•	Options used to customize editing behavior;

•	RepositoryItem specifies the repository item for a row;

•	Value used to specify values for rows.


TcxCustomEditorRow.Styles

TcxCustomEditorRow

Represents a set of styles defining the appearance of the editor row.

property Styles: TcxEditorRowStyles;

Description

The Styles property references the TcxEditorRowStyles object whose properties represent styles for header (see Header) and data cells (see Content) of the editor row.


TcxCustomEditorRow.CreateHeaderInfo

TcxCustomEditorRow

Creates object of the TcxEditorRowHeaderInfo class used to render headers of the editor rows.

function CreateHeaderInfo: TcxCustomRowHeaderInfo; override;

Description

The CreateHeaderInfo is a factory method, instantiates and returns the TcxEditorRowHeaderInfo object used to render headers of the editor rows.

The following TcxEditorRowHeaderInfo properties are used to render editor row headers:

•	ButtonColor provides the background color of the expand button within the row;

•	ButtonRect describes the rectangle occupied by the expand button within the row;

•	CaptionsInfo provides view information about a row header’s caption;

•	CategoryIndents provides information about the indents of the category rows within the current row header;

•	Focused indicates whether the row header is focused;

•	FocusRect represents the rectangle of the row header focus;

•	HeaderCellsRect represents the rectangle occupied by the row header cells;

•	HeaderRect represents the rectangle of the entire header;

•	IndentBounds represents the indent bounds rectangle of the row header;

•	LinesInfo provides information about lines to be displayed in the row header;

•	RowIndents provides row indents rectangles;

•	ShowButton indicates whether the row header contains an expand button;

•	ViewParams provides the row header view parameters.


TcxCustomEditorRow.CreateViewInfo

TcxCustomEditorRow

Creates object of the TcxEditorRowViewInfo class used to render editor row.

function CreateViewInfo: TcxCustomRowViewInfo; override;

Description

The CreateViewInfo is a factory method, instantiates and returns the TcxEditorRowViewInfo object used to render the editor rows.


TcxCustomMultiEditorRow
TcxCustomMultiEditorRow Object

Hierarchy          Properties          Methods

Represents the base class for multi editor rows in the grid control.

Unit

cxVGrid

TcxCustomMultiEditorRow = class(TcxCustomRow)

Description

Item is a data entity. When formatted one item occupies one cell per column in a row (one cell for the item name in a header column and one cell for the item value in a data column).

The multi editor row can hold any number of items. Respectively the number of cells in a column in the multi editor row depends on the number of items it holds.

This type contrasts with editor row that holds only one item and has respectively only one cell in a column.

This class introduces multi editor row functionality (editing capabilities, data binding, styles, etc.) that is used in derived classes TcxMultiEditorRow or TcxDBMultiEditorRow.

The TcxCustomMultiEditorRow implements all abstract methods declared in its ancestor the TcxCustomRow class.

Do not instantiate the TcxCustomEditorRow class. Use its descendants such as TcxMultiEditorRow or TcxDBMultiEditorRow.


TcxCustomMultiEditorRow Hierarchy
Hierarchy

TComponent

     |

TcxCustomRow

     |


Properties for TcxCustomMultiEditorRow
TcxCustomMultiEditorRow Properties

TcxCustomMultiEditorRow          Legend

In TcxCustomMultiEditorRow

Properties

Styles

Derived from TcxCustomRow

AbsoluteIndex

Count

Expanded

Height

Index

Level

Options

OwnerRows

Parent

Rows

Styles

VerticalGrid

ViewInfo

Visible

VisibleIndex


Methods for TcxCustomMultiEditorRow
TcxCustomMultiEditorRow Methods

TcxCustomMultiEditorRow          Legend

In TcxCustomMultiEditorRow

 CreateHeaderInfo

 CreateViewInfo

Derived from TcxCustomRow

 Assign

 Changed

 Collapse

 Expand

 GetFirstVisibleChild

 GetLastVisibleChild

 HasChildren

 HasVisibleChildren

 IndexOf

 IsChild

 IsFirst

 IsFirstVisible

 IsLast

 IsLastVisible

 IsParent

 IsRootLevel

 MakeVisible

 RestoreDefaults


TcxCustomMultiEditorRow.Properties

TcxCustomMultiEditorRow

Represents a set of attributes to control multi editor row behavior.

property Properties: TcxMultiEditorRowProperties;

Description

Used to get access to the TcxMultiEditorRowProperties object. The TcxMultiEditorRowProperties class provides common for its derived classes attributes to control multi editor row behavior.

The Editors property published in the TcxMultiEditorRowProperties and its derived class TcxDBMultiEditorRowProperties is used to add items to the multi editor row.


TcxCustomMultiEditorRow.Styles

TcxCustomMultiEditorRow

Represents a set of styles defining the appearance of the editor row.

property Styles: TcxEditorRowStyles;

Description

The Styles property references an object of the TcxEditorRowStyles whose properties represent styles for header (see Header) and data cells (see Content) of the editor row.


TcxCustomMultiEditorRow.CreateHeaderInfo

TcxCustomMultiEditorRow

Creates object of the TcxMultiEditorRowHeaderInfo class used to render headers of the multi editor rows.

function CreateHeaderInfo: TcxCustomRowHeaderInfo; override;

Description

The CreateHeaderInfo is a factory method, instantiates and returns the TcxMultiEditorRowHeaderInfo object used to render headers of the multi editor rows.

The following TcxMultiEditorRowHeaderInfo properties used to render headers of the multi editor rows:

•	ButtonColor provides the background color of the expand button within the row;

•	ButtonRect describes the rectangle occupied by the expand button within the row;

•	CaptionsInfo provides view information about a row header’s caption;

•	CategoryIndents provides information about the indents of the category rows within the current row header;

•	Focused indicates whether the row header is focused;

•	FocusRect represents the rectangle of the row header focus;

•	HeaderCellsRect represents the rectangle occupied by the row header cells;

•	HeaderRect represents the rectangle of the entire header;

•	IndentBounds represents the indent bounds rectangle of the row header;

•	LinesInfo provides information about lines to be displayed in the row header;

•	RowIndents provides row indents rectangles;

•	ShowButton indicates whether the row header contains an expand button;

•	ViewParams provides the row header view parameters.


TcxCustomMultiEditorRow.CreateViewInfo

TcxCustomMultiEditorRow

Creates object of the TcxMultiEditorRowViewInfo class used to render multi editor row.

function CreateViewInfo: TcxCustomRowViewInfo; override;

Description

The CreateViewInfo is a factory method, instantiates and returns the TcxMultiEditorRowViewInfo object used to render the multi editor rows. Besides that this method assigns reference from the TcxMultiEditorRowViewInfo object to the TcxCellEdit.ViewInfo property.


TcxEditorRow
TcxEditorRow Object

Hierarchy          Properties          Methods

Represents an editor row in the grid control.

Unit

cxVGrid

TcxEditorRow = class(TcxCustomEditorRow)

Description

The TcxEditorRow is used to represent a row with one header or data cell per column. This type of row supports editing capabilities. The type of editor bound to the row specifies the kind of editing. To bind an editor to the row use either TcxCustomEditorRowProperties.EditProperties or TcxCustomEditorRowProperties.RepositoryItem objects.

Properties, TcxCustomRow.Options and TcxCustomEditorRow.Styles properties are used to customize behavior and appearance of the row.

The following image demonstrates the editor row:


TcxEditorRow Hierarchy
Hierarchy

TComponent

     |

TcxCustomRow

     |

TcxCustomEditorRow

     |


Properties for TcxEditorRow
TcxEditorRow Properties

TcxEditorRow          Legend

In TcxEditorRow

Properties

Derived from TcxCustomEditorRow

Properties

Styles

Derived from TcxCustomRow

AbsoluteIndex

Count

Expanded

Height

Index

Level

Options

OwnerRows

Parent

Rows

Styles

VerticalGrid

ViewInfo

Visible

VisibleIndex


Methods for TcxEditorRow
TcxEditorRow Methods

TcxEditorRow          Legend

Derived from TcxCustomEditorRow

 CreateHeaderInfo

 CreateViewInfo

Derived from TcxCustomRow

 Assign

 Changed

 Collapse

 Expand

 GetFirstVisibleChild

 GetLastVisibleChild

 HasChildren

 HasVisibleChildren

 IndexOf

 IsChild

 IsFirst

 IsFirstVisible

 IsLast

 IsLastVisible

 IsParent

 IsRootLevel

 MakeVisible

 RestoreDefaults


TcxEditorRow.Properties

TcxEditorRow

Represents a set of attributes to control editor row behavior.

property Properties: TcxEditorRowProperties;

Description

Used to get access to the TcxEditorRowProperties object that provides a set of attributes to control the editor row behavior.

The following TcxEditorRowProperties published properties control row behavior:

•	EditProperties specifies the properties of an inplace editor used for editing the row contents;

•	Options used to customize editing behavior;

•	RepositoryItem specifies the repository item for a row;

•	Value specifies values for rows.


TcxMultiEditorRow
TcxMultiEditorRow Object

Hierarchy          Properties          Methods

Represents the multi editor row in the grid control.

Unit

cxVGrid

TcxMultiEditorRow = class(TcxCustomMultiEditorRow)

Description

The TcxMultiEditorRow represents an editor row containing several data cells per data column. This type of row supports editing capabilities. The editing capabilities of the multi editor row are encapsulated in the TcxMultiEditorRowProperties.Editors property. It allows assigning a specific editor to each data cell.

Properties and Styles properties are used to customize behavior and appearance of the row.

The following image demonstrates the multi editor row:


TcxMultiEditorRow Hierarchy
Hierarchy

TComponent

     |

TcxCustomRow

     |

TcxCustomMultiEditorRow

     |


Properties for TcxMultiEditorRow
TcxMultiEditorRow Properties

TcxMultiEditorRow          Legend

Derived from TcxCustomMultiEditorRow

Properties

Styles

Derived from TcxCustomRow

AbsoluteIndex

Count

Expanded

Height

Index

Level

Options

OwnerRows

Parent

Rows

Styles

VerticalGrid

ViewInfo

Visible

VisibleIndex


Methods for TcxMultiEditorRow
TcxMultiEditorRow Methods

TcxMultiEditorRow          Legend

Derived from TcxCustomMultiEditorRow

 CreateHeaderInfo

 CreateViewInfo

Derived from TcxCustomRow

 Assign

 Changed

 Collapse

 Expand

 GetFirstVisibleChild

 GetLastVisibleChild

 HasChildren

 HasVisibleChildren

 IndexOf

 IsChild

 IsFirst

 IsFirstVisible

 IsLast

 IsLastVisible

 IsParent

 IsRootLevel

 MakeVisible

 RestoreDefaults


TcxCategoryRow
TcxCategoryRow Object

Hierarchy          Properties          Methods

Represents category row in the grid control.

Unit

cxVGrid

TcxCategoryRow = class(TcxCustomRow)

Description

The TcxCategoryRow is used to arrange related editor rows in groups. You might need it if editor rows displayed in your vertical grid control can be logically divided into categories. In this case related rows must be added to the corresponding category row as children. If this has been performed, end users can expand/collapse category rows at runtime thus showing and hiding rows belonging to a specific category.

This type of row doesn’t display data.

Properties, Options and Styles properties are used to customize behavior and appearance of the row.

The following images demonstrate category row:

Category row expanded

Category row collapsed


TcxCategoryRow Hierarchy
Hierarchy

TComponent

     |

TcxCustomRow

     |


Properties for TcxCategoryRow
TcxCategoryRow Properties

TcxCategoryRow          Legend

In TcxCategoryRow

Properties

Styles

Derived from TcxCustomRow

AbsoluteIndex

Count

Expanded

Height

Index

Level

Options

OwnerRows

Parent

Rows

Styles

VerticalGrid

ViewInfo

Visible

VisibleIndex


Methods for TcxCategoryRow
TcxCategoryRow Methods

TcxCategoryRow          Legend

Derived from TcxCustomRow

 Assign

 Changed

 Collapse

 Expand

 GetFirstVisibleChild

 GetLastVisibleChild

 HasChildren

 HasVisibleChildren

 IndexOf

 IsChild

 IsFirst

 IsFirstVisible

 IsLast

 IsLastVisible

 IsParent

 IsRootLevel

 MakeVisible

 RestoreDefaults


TcxCategoryRow.Properties

TcxCategoryRow

Represents a set of attributes to control category row behavior.

property Properties: TcxCaptionRowProperties;

Description

Used to get access to the TcxCaptionRowProperties object that provides a set of attributes to control such settings of the category row as row caption, header alignment and header image.


TcxCategoryRow.Styles

TcxCategoryRow

Represents a set of styles defining the appearance of the category row.

property Styles: TcxCategoryRowStyles;

Description

The Styles property references the TcxCategoryRowStyles object whose properties represent styles (see Header) for the category row.


TcxCaptionRowProperties
TcxCaptionRowProperties Object

Hierarchy          Properties          Methods

Represents settings that define the behavior of the header or category row for the editor.

Unit

cxVGrid

TcxCaptionRowProperties = class(TcxCustomRowProperties)

Description

This class contains settings that define the behavior for the editor row header or category row.


TcxCaptionRowProperties Hierarchy
Hierarchy

TCollectionItem

     |

TcxInterfacedCollectionItem

     |

TcxCustomRowProperties

     |


Properties for TcxCaptionRowProperties
TcxCaptionRowProperties Properties

TcxCaptionRowProperties          Legend

In TcxCaptionRowProperties

Caption

HeaderAlignmentHorz

HeaderAlignmentVert

Hint

ImageIndex

Derived from TcxCustomRowProperties

Row


Methods for TcxCaptionRowProperties
TcxCaptionRowProperties Methods

TcxCaptionRowProperties          Legend

In TcxCaptionRowProperties

 CreateEx

Derived from TcxCustomRowProperties

 CreateEx


TcxCaptionRowProperties.Caption

TcxCaptionRowProperties

Specifies the text for the current row header.

property Caption: TCaption;

Description

The Caption property describes the current row’s data. Use this property to specify the text for the current row header.


TcxCaptionRowProperties.HeaderAlignmentHorz

TcxCaptionRowProperties

Specifies the horizontal alignment of the row’s header text.

property HeaderAlignmentHorz: TAlignment;

Description

Use the HeaderAlignmentHorz property to define the horizontal alignment of the row’s header text.

This property has 3 predefined values:

Value	Meaning
taLeftJustify	Align text in the header to the left.
taRightJustify	Align text in the header to the right.
taCenter	Center text in the header.

The default value of the HeaderAlignmentHorz property is taLeftJustify.


TcxCaptionRowProperties.HeaderAlignmentVert

TcxCaptionRowProperties

Specifies the vertical alignment of the row’s header text.

property HeaderAlignmentVert: TcxAlignmentVert;

Description

Use the HeaderAlignmentVert property to define the vertical alignment of the row’s header text.

This property has 3 predefined values:

Value	Meaning
vaTop	Align in the header to the top.
vaBottom	Align text in the header to the bottom.
vaCenter	Center text in the header

The default value of the HeaderAlignmentVert property is vaTop.


TcxCaptionRowProperties.Hint

TcxCaptionRowProperties

Specifies the text in the hint window that appears when the user positions the mouse cursor over the row header.

property Hint: string;

Description

Use the Hint property to provide more information about the current row. If the row’s header width is not enough to display the row’s header text and the Hint property is not set then the hint window is automatically displayed with a text provided by the Caption property.

Note: The hint window displaying is also possible if the value of the TcxControlOptionsBehavior.CellHints property is True.


TcxCaptionRowProperties.ImageIndex

TcxCaptionRowProperties

Specifies the image index for the current row’s header.

property ImageIndex: TImageIndex;

Description

Use the ImageIndex property to specify the image index for the current row’s header.

If the value of the ImageIndex property for the current row is set to –1 this row will not display an image in its header.

Note also that rows will display header images if the TcxCustomVerticalGrid.Images property is set to the TImageList instance.

The default value of the ImageIndex property is -1.


TcxCaptionRowProperties.CreateEx

TcxCaptionRowProperties

Creates the TcxCaptionRowProperties instance.

constructor CreateEx(ARow: TcxCustomRow); override;

Description

Creates the TcxCaptionRowProperties object. CreateEx calls the constructor inherited from the TcxCustomRowProperties and passes the specified row as a parameter. All descendants must override this constructor.

The ARow parameter specifies the current row.


TcxCaptionRowProperties.DefaultCaption

TcxCaptionRowProperties

Returns the default header text if the Caption property is not assigned.

function DefaultCaption: string; virtual;

Description

This method returns the current row name or class name. Descendants may override this method to provide the default header text when the Caption property is not assigned.


TcxCaptionRowProperties.RestoreDefaults

TcxCaptionRowProperties

Restores the default status for the current row.

procedure RestoreDefaults; virtual;

Description

This method restores the default status for the current row. After that for example, the DefaultCaption property value will be applied.


TcxCustomEditorRowProperties
TcxCustomEditorRowProperties Object

Hierarchy          Properties          Methods          Events

Represents a set of attributes that define the behavior of the editor row.

Unit

cxVGrid

TcxCustomEditorRowProperties = class(TcxCaptionRowProperties, IcxEditorPropertiesContainer)

Description

The TcxCustomEditorRowProperties is the base class, which encapsulates settings used in its derived classes to control editor row behavior.


TcxCustomEditorRowProperties Hierarchy
Hierarchy

TCollectionItem

     |

TcxInterfacedCollectionItem

     |

TcxCustomRowProperties

     |

TcxCaptionRowProperties

     |


Properties for TcxCustomEditorRowProperties
TcxCustomEditorRowProperties Properties

TcxCustomEditorRowProperties          Legend

In TcxCustomEditorRowProperties

EditProperties

EditPropertiesClass

ItemIndex

Options

RepositoryItem

Value

Values

Derived from TcxCaptionRowProperties

Caption

HeaderAlignmentHorz

HeaderAlignmentVert

Hint

ImageIndex

Derived from TcxCustomRowProperties

Row


Methods for TcxCustomEditorRowProperties
TcxCustomEditorRowProperties Methods

TcxCustomEditorRowProperties          Legend

In TcxCustomEditorRowProperties

 Assign

 CreateEx

Derived from TcxCaptionRowProperties

 CreateEx

Derived from TcxCustomRowProperties

 Changed

 CreateEx


Events for TcxCustomEditorRowProperties
TcxCustomEditorRowProperties Events

TcxCustomEditorRowProperties          Legend

In TcxCustomEditorRowProperties

 OnGetDisplayText

 OnGetEditingProperties

 OnGetEditProperties


TcxCustomEditorRowProperties.EditProperties

TcxCustomEditorRowProperties          See Also

Represents a set of attributes specific to the editor available for editing row data.

property EditProperties: TcxCustomEditProperties;

Description

Used to set specific attributes that control the editor’s behavior. They define the alignment of the editor’s contents, the collection of buttons displayed, read-only status, etc.


TcxCustomEditorRowProperties.EditPropertiesClass

TcxCustomEditorRowProperties

Represents an editor available for data row editing.

property EditPropertiesClass: TcxCustomEditPropertiesClass;

Description

Used to assign a particular editor for data row editing. To assign an editor set the EditPropertiesClass property to the TcxCustomEditProperties class descendant.

The following code snippet demonstrates usage of the EditPropertiesClass property:

// Delphi

//...

uses

//...

cxSpinEdit;

type

  TForm1 = class(TForm)

    cxVerticalGrid1: TcxVerticalGrid;

    cxVerticalGrid1EditorRow1: TcxEditorRow;

//...

implementation

//...

// assign editor to the row

cxVerticalGrid1EditorRow1.Properties.EditPropertiesClass := TcxSpinEditProperties;

As an alternative you can use the OnGetEditProperties event (or OnGetEditingProperties) and the RepositoryItem property to assign a particular editor. It is the preferred means of binding the desired editor.  These events allow you to dynamically customize editors depending on end-user actions or assign a specific editor to a particular item.

If the OnGetEditProperties event is handled, settings defined by EditProperties and EditPropertiesClass are ignored.


TcxCustomEditorRowProperties.ItemIndex

TcxCustomEditorRowProperties          See Also

Returns an editor row’s index.

property ItemIndex: Integer;

ReadOnly Property


TcxCustomEditorRowProperties.Options

TcxCustomEditorRowProperties

Represents settings that control a user's capability to manipulate a row.

property Options: TcxEditorRowPropertiesOptions;

Description

The Options object contains a number of published settings inherited from its ancestor TcxCustomEditContainerItemOptions that enable or disable the operations a user can perform on the row at runtime. These settings include:

•	Editing - specifies whether editing of a row’s data cells is enabled;

•	Filtering - specifies whether the user can create a filter condition for the row;

•	Focusing - specifies whether a row’s data cell can be focused;

•	IncSearch - specifies whether an incremental search can be performed or not;

•	ShowEditButtons - specifies how editors are displayed in a row’s cells;

•	TabStop - specifies whether a user can navigate through rows using the Tab key.


TcxCustomEditorRowProperties.RepositoryItem

TcxCustomEditorRowProperties

Specifies the repository item for a row editor.

property RepositoryItem: TcxEditRepositoryItem;

Description

Repository item refers to the editor used to edit the row’s data. If you set an editor for the row via the RepositoryItem property the values of EditProperties and EditPropertiesClass are ignored. The higher priority for the editor set has the OnGetEditProperties event if assigned.


TcxCustomEditorRowProperties.Value

TcxCustomEditorRowProperties          See Also

Specifies the value for the data cell of the row’s focused record.

property Value: Variant;

Description

Use the Value property to specify or determine the row’s data cell value within the focused record.


TcxCustomEditorRowProperties.Values

TcxCustomEditorRowProperties          See Also

Provides indexed access to the row’s values.

property Values[Index:Integer]: Variant;

Description

Used to determine the required row’s value.

The Index parameter identifies the record index in a dataset.

ReadOnly Property


TcxCustomEditorRowProperties.Assign

TcxCustomEditorRowProperties

Assigns values to the current row’s properties.

procedure Assign(Source: TPersistent); override;

Description

This method assigns values to the current row’s properties.

The Source parameter specifies the TcxCustomEditorRowProperties object.


TcxCustomEditorRowProperties.CreateEx

TcxCustomEditorRowProperties

Creates new TcxCustomEditorRowProperties object.

constructor CreateEx(ARow: TcxCustomRow); override;

Description

Creates the TcxCustomEditorRowProperties object. CreateEx calls the constructor inherited from the TcxCaptionRowProperties and passes the specified row as a parameter. All descendants must override this constructor.

The ARow parameter specifies the current row.


TcxCustomEditorRowProperties.OnGetDisplayText

TcxCustomEditorRowProperties

Occurs when a data cell’s value is displayed.

type

  TcxVerticalGridGetDisplayTextEvent = procedure(Sender: TcxCustomEditorRowProperties; ARecord: Integer; var AText: string) of object;

property OnGetDisplayText: TcxVerticalGridGetDisplayTextEvent;

Description

Use the OnGetDisplayText event to specify the text representation of a row’s data cell value. The TcxCustomEditorRowProperties object is addressed by the Sender parameter.  The ARecord parameter identifies the index of the edited record. When this event occurs the AText argument already contains the string to be displayed but you are able to change it as required.


TcxCustomEditorRowProperties.OnGetEditingProperties

TcxCustomEditorRowProperties          See Also

Fires when the current row’s editor gets activated.

type

  TcxVerticalGridGetEditPropertiesEvent = procedure(Sender: TcxCustomEditorRowProperties; ARecordIndex: Integer; var AProperties: TcxCustomEditProperties) of object;

property OnGetEditingProperties: TcxVerticalGridGetEditPropertiesEvent;

Description

Use the OnGetEditingProperties event to specify a row’s data cell editor. The TcxCustomEditorRowProperties object is addressed by the Sender parameter. The ARecordIndex parameter identifies the index of the edited record. The AProperties represents settings of an in-place editor used for editing data in a cell.


TcxCustomEditorRowProperties.OnGetEditProperties

TcxCustomEditorRowProperties          See Also

Fires when a row’s data cell is displayed.

type

  TcxVerticalGridGetEditPropertiesEvent = procedure(Sender: TcxCustomEditorRowProperties; ARecordIndex: Integer; var AProperties: TcxCustomEditProperties) of object;

property OnGetEditProperties: TcxVerticalGridGetEditPropertiesEvent;

Description

Use the OnGetEditProperties event to specify a row’s data cell editor. The TcxCustomEditorRowProperties object is addressed by the Sender parameter. The ARecordIndex parameter identifies the index of the edited record. The AProperties parameter represents settings of an in-place editor used for editing data in a cell.

The OnGetEditProperties event has the higher priority. If an editor is assigned via the OnGetEditProperties event handler, the settings defined by the RepositoryItem, EditProperties and EditPropertiesClass are ignored.

The following example uses a TcxEditRepository component:

// Delphi

// ...

procedure TForm1.cxDBVerticalGrid1GradePropertiesGetEditProperties(

  Sender: TcxCustomEditorRowProperties; ARecordIndex: Integer;

  var AProperties: TcxCustomEditProperties);

var AItemOffset: Integer;

begin

  AItemOffset := 6;

  case ARecordIndex mod AItemOffset of

    0: AProperties := SpinItemYears.Properties;

    1, 2: AProperties := ImageComboLanguages.Properties;

    3: AProperties := ImageComboCommunication.Properties;

    4: AProperties := DateItemStartWorkFrom.Properties;

  end;

end;

// C++ Builder

// ...

void __fastcall TForm1::cxDBVerticalGrid1GradePropertiesGetEditProperties(

      TcxCustomEditorRowProperties *Sender, int ARecordIndex,

      TcxCustomEditProperties *&AProperties)

{

  int AItemOffset = 6;

  switch (static_cast<int>(fmod(ARecordIndex, AItemOffset))) {

    case 0: AProperties = SpinItemYears->Properties; break;

    case 1, 2: AProperties = ImageComboLanguages->Properties; break;

    case 3: AProperties = ImageComboCommunication->Properties; break;

    case 4: AProperties = DateItemStartWorkFrom->Properties; break;

  }

}

This is the code execution result:


TcxCustomRowProperties
TcxCustomRowProperties Object

Hierarchy          Properties          Methods

Represents base settings defining row behavior.

Unit

cxVGrid

TcxCustomRowProperties = class(TcxInterfacedCollectionItem)

Description

The TcxCustomRowProperties is the base class that represents settings used in its derived classes to control row behavior.


TcxCustomRowProperties Hierarchy
Hierarchy

TCollectionItem

     |

TcxInterfacedCollectionItem     |


Properties for TcxCustomRowProperties
TcxCustomRowProperties Properties

TcxCustomRowProperties          Legend

In TcxCustomRowProperties

Row


Methods for TcxCustomRowProperties
TcxCustomRowProperties Methods

TcxCustomRowProperties          Legend

In TcxCustomRowProperties

Changed

 CreateEx


TcxCustomRowProperties.Row

TcxCustomRowProperties

Identifies the current row.

property Row: TcxCustomRow;

Description

Use this property to get access to the TcxCustomRow object that identifies the current row.

ReadOnly Property


TcxCustomRowProperties.Changed

TcxCustomRowProperties

Forces the grid control to redraw itself when the properties of the current row are changed.

procedure Changed; virtual;

Description

Forces the grid control to redraw itself when the properties of the current row are changed.


TcxCustomRowProperties.CreateEx

TcxCustomRowProperties

Creates a new instance of the TcxCustomRowProperties class.

constructor CreateEx(ARow: TcxCustomRow); virtual;

Description

Creates a new instance of the TcxCustomRowProperties class. CreateEx calls the constructor inherited from the TCollectionItem to set a collection of items used in its descendants. Override this constructor if you implement the TcxCustomRowProperties descendant.

The ARow parameter specifies the current row.


TcxEditorRowItemProperties
TcxEditorRowItemProperties Object

Hierarchy          Properties          Methods          Events

Contains settings that define the behavior of an item in a multi editor row.

Unit

cxVGrid

TcxEditorRowItemProperties = class(TcxCollectionItemEditorRowProperties)

Description

The item is a data entity. When formatted one item occupies one cell per column in a row (one cell for the item name in a header column and one cell for the item value in a data column).

The editor row (see TcxCustomEditorRow) holds only one item. So the editor row has one cell in a column.

The multi editor row (see TcxCustomMultiEditorRow) can hold any number of items. Respectively the number of cells in a column in the multi editor row depends on the number of items it holds.

The TcxEditorRowItemProperties class is used to work with items in the multi editor row. The TcxEditorRowItemProperties class defines settings for these items.


TcxEditorRowItemProperties Hierarchy
Hierarchy

TCollectionItem

     |

TcxInterfacedCollectionItem

     |

TcxCustomRowProperties

     |

TcxCaptionRowProperties

     |

TcxCustomEditorRowProperties

     |

TcxCollectionItemEditorRowProperties

     |


Properties for TcxEditorRowItemProperties
TcxEditorRowItemProperties Properties

TcxEditorRowItemProperties          Legend

Derived from TcxCollectionItemEditorRowProperties

Width

Derived from TcxCustomEditorRowProperties

EditProperties

EditPropertiesClass

Options

RepositoryItem

Value

Values

Derived from TcxCaptionRowProperties

Caption

HeaderAlignmentHorz

HeaderAlignmentVert

Hint

ImageIndex

Derived from TcxCustomRowProperties

Row


Methods for TcxEditorRowItemProperties
TcxEditorRowItemProperties Methods

TcxEditorRowItemProperties          Legend

In TcxEditorRowItemProperties

 Assign

Derived from TcxCollectionItemEditorRowProperties

 CreateEx

Derived from TcxCustomEditorRowProperties

 Assign

 CreateEx

Derived from TcxCaptionRowProperties

 CreateEx

Derived from TcxCustomRowProperties

 Changed

 CreateEx


Events for TcxEditorRowItemProperties
TcxEditorRowItemProperties Events

TcxEditorRowItemProperties          Legend

Derived from TcxCustomEditorRowProperties

 OnGetDisplayText

 OnGetEditingProperties

 OnGetEditProperties


TcxEditorRowItemProperties.Assign

TcxEditorRowItemProperties

Assigns values to the current multi editor row item’s properties.

procedure Assign(Source: TPersistent); override;

Description

This method assigns values to the current multi editor row item’s properties.

The Source parameter specifies the TcxEditorRowItemProperties object.


TcxEditorRowProperties
TcxEditorRowProperties Object

Hierarchy          Properties          Methods          Events

Represents settings that define the editor’s row behavior.

Unit

cxVGrid

TcxEditorRowProperties = class(TcxCustomEditorRowProperties)

Description

The TcxEditorRowProperties provides settings used to control the editor’s row behavior.


TcxEditorRowProperties Hierarchy
Hierarchy

TCollectionItem

     |

TcxInterfacedCollectionItem

     |

TcxCustomRowProperties

     |

TcxCaptionRowProperties

     |

TcxCustomEditorRowProperties

     |

TcxEditorRowProperties


Properties for TcxEditorRowProperties
TcxEditorRowProperties Properties

TcxEditorRowProperties          Legend

Derived from TcxCustomEditorRowProperties

EditProperties

EditPropertiesClass

Options

RepositoryItem

Value

Values

Derived from TcxCaptionRowProperties

Caption

HeaderAlignmentHorz

HeaderAlignmentVert

Hint

ImageIndex

Derived from TcxCustomRowProperties

Row


Methods for TcxEditorRowProperties
TcxEditorRowProperties Methods

TcxEditorRowProperties          Legend

In TcxEditorRowProperties

 Assign

Derived from TcxCustomEditorRowProperties

 Assign

 CreateEx

Derived from TcxCaptionRowProperties

 CreateEx

Derived from TcxCustomRowProperties

 Changed

 CreateEx


Events for TcxEditorRowProperties
TcxEditorRowProperties Events

TcxEditorRowProperties          Legend

Derived from TcxCustomEditorRowProperties

 OnGetDisplayText

 OnGetEditingProperties

 OnGetEditProperties


TcxEditorRowProperties.Assign

TcxEditorRowProperties

Assigns values to the current editor’s row properties.

procedure Assign(Source: TPersistent); override;

Description

This method assigns values to the current editor’s row properties.

The Source parameter specifies the TcxEditorRowProperties object.


TcxMultiEditorRowProperties
TcxMultiEditorRowProperties Object

Hierarchy          Properties          Methods

Represents settings that define the multi editor row’s behavior.

Unit

cxVGrid

TcxMultiEditorRowProperties = class(TcxCustomRowProperties)

Description

The TcxMultiEditorRowProperties provides settings used to control the multi editor row’s behavior.


TcxMultiEditorRowProperties Hierarchy
Hierarchy

TCollectionItem

     |

TcxInterfacedCollectionItem

     |

TcxCustomRowProperties

     |

TcxMultiEditorRowProperties


Properties for TcxMultiEditorRowProperties
TcxMultiEditorRowProperties Properties

TcxMultiEditorRowProperties          Legend

In TcxMultiEditorRowProperties

Editors

Fixed

SeparatorAlignmentVert

SeparatorKind

SeparatorString

Derived from TcxCustomRowProperties

Row


Methods for TcxMultiEditorRowProperties
TcxMultiEditorRowProperties Methods

TcxMultiEditorRowProperties          Legend

In TcxMultiEditorRowProperties

Assign

CreateEx

Derived from TcxCustomRowProperties

 	Changed

 CreateEx


TcxMultiEditorRowProperties.Editors

TcxMultiEditorRowProperties          See Also

Represents a collection of the multi editor row’s items.

property Editors: TcxEditorPropertiesCollection;

Description

Use the Editors property to assign items to the current multi editor row or to get indexed access to the specified item. The TcxEditorRowItemProperties class represents an item. It defines settings for the item used in the multi editor row.


TcxMultiEditorRowProperties.Fixed

TcxMultiEditorRowProperties

Specifies if all items of the multi editor row will be resized when the user drags the right edge of the band.

property Fixed: Boolean;

Description

The user can work in a bands view layout (see TcxVirtualVerticalGrid.LayoutStyle). When working in a bands view layout the user can resize (if the value of the TcxvgOptionsBehavior.BandSizing property is True) the band’s width within the grid control client area by dragging the right edge of the band. When the value of the Fixed property is True only the right most item in the multi editor row will be resized. Otherwise resizing will affect all the items in the multi editor row.

When the value of the TcxvgOptionsView.AutoScaleBands property is True the band fills the width of the control client area and band resizing is unavailable.

The default value of the Fixed property is False.


TcxMultiEditorRowProperties.SeparatorAlignmentVert

TcxMultiEditorRowProperties

Specifies the vertical alignment of the row header separator.

property SeparatorAlignmentVert: TcxAlignmentVert;

Description

The row header separator divides row header into sections for each item.

Use the SeparatorAlignmentVert property to define the vertical alignment of the row header separator. This property is applied if the value of the SeparatorKind property is skString.

This property has 3 predefined values:

Value	Meaning
vaTop	Align the separator to the top in the header
vaBottom	Align the separator to the bottom in the header
vaCenter	Center the separator in the header

The default value of the SeparatorAlignmentVert property is vaTop.


TcxMultiEditorRowProperties.SeparatorKind

TcxMultiEditorRowProperties

Specifies the row header separator type.

property SeparatorKind: TSeparatorKind;

Description

The row header separator divides row header into sections for each item. When the value of the SeparatorKind property is skVertLine the separator is a vertical line. If the value of the SeparatorKind property is skString the separator is any character that is assigned to the SeparatorString property.

This property has 2 predefined values:

Value	Meaning
skVertLine	Vertical line is used as the separator
skString	String is used as the separator

The following snapshots demonstrate these separators:

Vertical line separator

String separator

The default value of the SeparatorKind property is skVertLine.


TcxMultiEditorRowProperties.SeparatorString

TcxMultiEditorRowProperties

Specifies the string used as the row header separator.

property SeparatorString: string;

Description

The row header separator divides row headers into sections for each item. Use this property to set any character as the separator. The SeparatorString is applied if the value of the SeparatorKind property is skString.


TcxMultiEditorRowProperties.Assign

TcxMultiEditorRowProperties

Assigns values to the current multi editor’s row properties.

procedure Assign(Source: TPersistent); override;

Description

This method assigns values to the current multi editor’s row properties.

The Source parameter specifies the TcxMultiEditorRowProperties object.


TcxMultiEditorRowProperties.CreateEx

TcxMultiEditorRowProperties

Creates a new instance of the TcxMultiEditorRowProperties class.

constructor CreateEx(ARow: TcxCustomRow); override;

Description

Creates a new instance of the TcxMultiEditorRowProperties class. Override this constructor if you implement the TcxMultiEditorRowProperties descendant.

The ARow parameter specifies the current row.


TcxMultiEditorRowPropertiesOptions
TcxMultiEditorRowPropertiesOptions Object

Hierarchy          Properties

Contains options for the multi editor row item.

Unit

cxVGrid

TcxMultiEditorRowPropertiesOptions = class(TcxCustomEditContainerItemOptions);

Description

The MultiEditor rows may contain several items. These items represent data items in the multi editor row, each item implements the functionality of the editor row. The TcxMultiEditorRowPropertiesOptions settings affect the user’s ability to manipulate an item: editing, focusing, incremental searching, etc. The TcxMultiEditorRowPropertiesOptions introduces no new behavior, it just publishes properties inherited from its ancestor the TcxCustomEditContainerItemOptions class.


TcxMultiEditorRowPropertiesOptions Hierarchy
Hierarchy

TPersistent

     |

TcxOwnedPersistent

     |

TcxCustomEditContainerItemOptions

     |


Properties for TcxMultiEditorRowPropertiesOptions
TcxMultiEditorRowPropertiesOptions Properties

TcxMultiEditorRowPropertiesOptions          Legend

Derived from TcxCustomEditContainerItemOptions

Editing

Filtering

Focusing

IncSearch

ShowEditButtons

TabStop


TcxVerticalGridCustomizing
TcxVerticalGridCustomizing Object

Hierarchy          Properties          See Also

Represents the grid’s Customization Form.

Unit

cxVGrid

TcxVerticalGridCustomizing = class(TcxOwnedInterfacedPersistent)

Description

When working with the Customization Form the user can rearrange rows by dragging them to or from the Customization Form, or within the grid control.

To activate the layout customization session set the Visible property to True.


TcxVerticalGridCustomizing Hierarchy
Hierarchy

TPersistent

     |

TcxOwnedPersistent

     |

TcxOwnedInterfacedPersistent

     |

TcxVerticalGridCustomizing


Properties for TcxVerticalGridCustomizing
TcxVerticalGridCustomizing Properties

TcxVerticalGridCustomizing          Legend

In TcxVerticalGridCustomizing

RowCount

ShowCategoryButtons

ShowCategoryTab

Visible


TcxVerticalGridCustomizing.RowCount

TcxVerticalGridCustomizing

Specifies the number of visible rows in the Customization Form.

property RowCount: Integer;

Description

Use the RowCount property to specify the number of visible rows in the Customization Form. The height of the Customization Form window depends on this property when the Customization Form window appears the first time. The user can then change the height of the Customization Form window by dragging its bottom edge.

The default value of the RowCount property is 10.


TcxVerticalGridCustomizing.ShowCategoryButtons

TcxVerticalGridCustomizing          See Also

Specifies whether editing buttons are displayed in the Customization Form’s Categories page.

property ShowCategoryButtons: Boolean;

Description

The New and Delete buttons allow end-users to enter new category rows, or delete existing ones.

If the ShowCategoryButtons property is False, these buttons are hidden:

Note: if the ShowCategoryTab property is False, the Categories page is not displayed.


TcxVerticalGridCustomizing.ShowCategoryTab

TcxVerticalGridCustomizing          See Also

Specifies whether the Categories page is to be displayed in the Customization Form.

property ShowCategoryTab: Boolean;

Description

With the Categories page, end-users can change the layout of category rows in the grid.

If the ShowCategoryTab property is False, this page is hidden and thus prevents rearrangement of category rows using the Customization Form.


TcxVerticalGridCustomizing.Visible

TcxVerticalGridCustomizing

Activates the Customization Form.

property Visible: Boolean;

Description

Set the Visible property to True to activate the Customization Form. Now the user can rearrange rows by dragging them to or from the Customization Form, or within the grid control.


TcxVirtualVerticalGrid
TcxVirtualVerticalGrid Object

Hierarchy          Properties          Methods          Events

Represents the vertical grid control that implements single record, multi record and banded layouts.

Unit

cxVGrid

TcxVirtualVerticalGrid = class(TcxCustomVerticalGrid)

Description

The TcxVirtualVerticalGrid class represents a vertical grid control with single record, multi record and banded layouts. The grid is able to work in Provider Mode.  It inherits its basic functionality from its ancestor and declares the LayoutStyle property.  This property controls the records layout:

•	single record layout – the vertical grid control displays a single record at a time.  If the control’s height is less than the record’s height, a vertical scrollbar is displayed.

•	banded layout – the vertical grid control displays a single record at a time.  If the record’s height is greater than the control’s height, the record is wrapped within the control.

•	multi record layout – the vertical grid displays a header column with row captions and several data columns, corresponding to different records.  If the control’s height is less than the record’s height, a vertical scrollbar is displayed.

The TcxVirtualVerticalGrid class is the base class for the TcxDBVerticalGrid control and also implements TcxFilterControl and TcxNavigator functionality.


TcxVirtualVerticalGrid Hierarchy
Hierarchy

TcxExtEditingControl

     |

TcxCustomVerticalGrid

     |


Properties for TcxVirtualVerticalGrid
TcxVirtualVerticalGrid Properties

TcxVirtualVerticalGrid          Legend

In TcxVirtualVerticalGrid

LayoutStyle

OptionsBehavior

OptionsData

Derived from TcxCustomVerticalGrid

Customizing

FocusedRow

HitTest

Images

OptionsBehavior

OptionsData

OptionsView

Rows

StoringName

Styles

TopVisibleRowIndex

ViewInfo


Methods for TcxVirtualVerticalGrid
TcxVirtualVerticalGrid Methods

TcxVirtualVerticalGrid          Legend

Derived from TcxCustomVerticalGrid

Add

AddChild

AssignRows

CancelEdit

ClearRows

FirstRow

FirstVisibleRow

FullCollapse

FullExpand

HasRows

HasVisibleRows

HideEdit

IsInternalDragging

IsRowVisible

LastRow

LastVisibleRow

NextRow

NextVisibleRow

PrevRow

PrevVisibleRow

Remove

RestoreDefaults

RestoreFromIniFile

RestoreFromRegistry

RestoreFromStream

RowByCaption

RowByName

ShowEdit

ShowEditByKey

ShowEditByMouse

StoreToIniFile

StoreToRegistry

StoreToStream


Events for TcxVirtualVerticalGrid
TcxVirtualVerticalGrid Events

TcxVirtualVerticalGrid          Legend

In TcxVirtualVerticalGrid

OnFilterControlDialogShow

OnFilterRecord

OnFocusedRecordChanged

Derived from TcxCustomVerticalGrid

OnDrawBackground

OnDrawRowHeader

OnDrawValue

OnItemChanged

OnLeftVisibleBandIndexChanged

OnLeftVisibleRecordIndexChanged

OnTopRowIndexChanged


TcxVirtualVerticalGrid.LayoutStyle

TcxVirtualVerticalGrid

Specifies the record layout within the control.

property LayoutStyle: TcxvgLayoutStyle;

Description

Use the LayoutStyle property to specify the record layout within the control.  The list of possible values is given below:

Value	Meaning	Picture
lsSingleRecordView	The vertical grid control displays a single record at a time.  If the control’s height is less than the record’s height, a vertical scrollbar is displayed.
lsMultiRecordView	The grid displays a header column with row captions and several data columns, corresponding to different records.  If the control’s height is less than the record’s height, a vertical scrollbar is displayed.
lsBandsView	The control displays a single record at a time.  If the record’s height is greater than the control’s height, the record is wrapped within the control.

The default value of the LayoutStyle property is lsSingleRecordView.


TcxVirtualVerticalGrid.OptionsBehavior

TcxVirtualVerticalGrid

Provides access to settings determining the grid control’s response to user actions.

property OptionsBehavior: TcxvgMultiRecordsOptionsBehavior;

Description

Use the OptionsBehavior property to control the grid view’s response to user actions via the mouse and keyboard.  These property settings determine whether cell editors are always active and whether focus can be changed using the Tab & Enter keys, etc.


TcxVirtualVerticalGrid.OptionsData

TcxVirtualVerticalGrid

Controls the data-aware functionality of a grid control in multi record layout.

property OptionsData: TcxvgMultiRecordsOptionsData;

Description

Use the OptionsData property to access the options affecting data-aware functionality of a grid displaying multiple records.  The data options control whether record deletion is allowed, whether confirmation is required before record deletion and if records can be inserted.


TcxVirtualVerticalGrid.OnFilterControlDialogShow

TcxVirtualVerticalGrid

Occurs before displaying the Filter Building dialog.

type

  TNotifyEvent = procedure(Sender: TObject) of object;

property OnFilterControlDialogShow: TNotifyEvent;

Description

The OnFilterControlDialogShow event occurs before displaying the vertical grid control’s Filter Building.  The dialog form is passed as the Sender parameter.  It represents a TfmFilterControlDialog class.  The form holds a filter control (TcxFilterControl) and you can obtain access to this via the form’s FilterControl property.  Use its properties and events to customize the filter control’s default appearance and behavior.


TcxVirtualVerticalGrid.OnFilterRecord

TcxVirtualVerticalGrid

Fires when the data controller is about to perform internal filtering.

type

TcxDataFilterRecordEvent = procedure(ADataController:

  TcxCustomDataController; ARecordIndex: Integer; var Accept:

  Boolean) of object;

property OnFilterRecord: TcxDataFilterRecordEvent;

Description

Implement the OnFilterRecord event handler to provide custom filter conditions.

The ADataController parameter specifies the data controller;

The ARecordIndex parameter specifies the record index;

The Accept parameter specifies the visibility of the filtered records. Set the Accept parameter to True to make the filtered records visible or to False to hide the filtered records.

Consider the following example:

// Delphi

Accept := ADataController.Values[ARecordIndex, fldTrademark.Properties.ItemIndex] = 'BMW';

The fldTrademark is a dataset field containing information about car trademarks. When the above code is run only records with a value of 'BMW' in the fldTrademark field will be loaded.


TcxVirtualVerticalGrid.OnFocusedRecordChanged

TcxVirtualVerticalGrid

Fires after an active record has been changed.

type

  TcxVerticalGridFocusedRecordChangedEvent = procedure(Sender: TcxVirtualVerticalGrid; APrevFocusedRecord, AFocusedRecord: Integer) of object;

property OnFocusedRecordChanged: TcxVerticalGridFocusedRecordChangedEvent;

Description

Implement the OnFocusedRecordChanged event handler to provide custom code after focus has switched to another record.

The Sender parameter specifies the vertical grid control that generated this event.

The APrevFocusedRecord parameter specifies the record that has lost focus. This parameter returns –1 value if there was no focused record before.

The AFocusedRecord parameter specifies the record that has gained focus.


TcxUnboundVerticalGrid
TcxUnboundVerticalGrid Object

Hierarchy          Properties          Methods          Events

Represents the base class for vertical grid controls implementing single record and banded layouts.

Unit

cxVGrid

TcxUnboundVerticalGrid = class(TcxCustomVerticalGrid)

Description

The TcxUnboundVerticalGrid is the base class for single record and banded layouts (TcxVerticalGrid).  It inherits its basic functionality from the TcxCustomVerticalGrid class and declares the LayoutStyle property.  This property controls the record layout:

•	single record layout – the vertical grid control displays a single record at a time.  If the control’s height is less than the record’s height, a vertical scrollbar is displayed.

•	banded layout – the vertical grid control displays a single record at a time.  If the record’s height is greater than the control’s height, the record is wrapped within the control.


TcxUnboundVerticalGrid Hierarchy
Hierarchy

TcxExtEditingControl

     |

TcxCustomVerticalGrid

     |


Properties for TcxUnboundVerticalGrid
TcxUnboundVerticalGrid Properties

TcxUnboundVerticalGrid          Legend

In TcxUnboundVerticalGrid

LayoutStyle

Derived from TcxCustomVerticalGrid

Customizing

FocusedRow

HitTest

Images

OptionsBehavior

OptionsData

OptionsView

Rows

StoringName

Styles

TopVisibleRowIndex

ViewInfo


Methods for TcxUnboundVerticalGrid
TcxUnboundVerticalGrid Methods

TcxUnboundVerticalGrid          Legend

Derived from TcxCustomVerticalGrid

Add

AddChild

AssignRows

CancelEdit

ClearRows

FirstRow

FirstVisibleRow

FullCollapse

FullExpand

HasRows

HasVisibleRows

HideEdit

IsInternalDragging

IsRowVisible

LastRow

LastVisibleRow

NextRow

NextVisibleRow

PrevRow

PrevVisibleRow

Remove

RestoreDefaults

RestoreFromIniFile

RestoreFromRegistry

RestoreFromStream

RowByCaption

RowByName

ShowEdit

ShowEditByKey

ShowEditByMouse

StoreToIniFile

StoreToRegistry

StoreToStream


Events for TcxUnboundVerticalGrid
TcxUnboundVerticalGrid Events

TcxUnboundVerticalGrid          Legend

Derived from TcxCustomVerticalGrid

OnDrawBackground

OnDrawRowHeader

OnDrawValue

OnItemChanged

OnLeftVisibleBandIndexChanged

OnLeftVisibleRecordIndexChanged

OnTopRowIndexChanged


TcxUnboundVerticalGrid.LayoutStyle

TcxUnboundVerticalGrid

Specifies the record layout within the control.

type

  TcxvgUnboundLayoutStyle = (ulsBandsView, ulsSingleRecordView);

property LayoutStyle: TcxvgUnboundLayoutStyle;

Description

The LayoutStyle property controls the record layout.  The list of possible values is given below:

Value	Meaning	Picture
ulsSingleRecordView	The vertical grid control displays a single record at a time.  If the control’s height is less than the record’s height, a vertical scrollbar is displayed.
ulsBandsView	The vertical grid control displays a single record at a time.  If the record’s height is greater than the control’s height, the record is wrapped within the control.

The default value of the LayoutStyle property is ulsSingleRecordView.


TcxVerticalGrid
TcxVerticalGrid Object

Hierarchy          Properties          Methods          Events

Represents the cxVerticalGrid control.

Unit

cxVGrid

TcxVerticalGrid = class(TcxUnboundVerticalGrid)

Description

The TcxVerticalGrid class represents the cxVerticalGrid control.

It inherits its basic functionality from the TcxUnboundVerticalGrid class and publishes the LayoutStyle property.  This property controls the record layout:

•	single record layout – the vertical grid control displays a single record at a time.  If the control’s height is less than the record’s height, a vertical scrollbar is displayed.

•	banded layout – the vertical grid control displays a single record at a time.  If the record’s height is greater than the control’s height, the record is wrapped within the control.

The TcxVerticalGrid class provides several option sets affecting aspects of the control’s functionality and appearance:

•	OptionsBehavior, these settings determine how the vertical grid control will react to end-user actions;

•	OptionsData, these settings determine the functionality of a data-aware grid control;

•	OptionsView, these settings control the appearance of the vertical grid control.


TcxVerticalGrid Hierarchy
Hierarchy

TcxExtEditingControl

     |

TcxCustomVerticalGrid

     |

TcxUnboundVerticalGrid

     |


Properties for TcxVerticalGrid
TcxVerticalGrid Properties

TcxVerticalGrid          Legend

Derived from TcxUnboundVerticalGrid

LayoutStyle

Derived from TcxCustomVerticalGrid

Customizing

FocusedRow

HitTest

Images

OptionsBehavior

OptionsData

OptionsView

Rows

StoringName

Styles

TopVisibleRowIndex

ViewInfo


Methods for TcxVerticalGrid
TcxVerticalGrid Methods

TcxVerticalGrid          Legend

Derived from TcxCustomVerticalGrid

Add

AddChild

AssignRows

CancelEdit

ClearRows

FirstRow

FirstVisibleRow

FullCollapse

FullExpand

HasRows

HasVisibleRows

HideEdit

IsInternalDragging

IsRowVisible

LastRow

LastVisibleRow

NextRow

NextVisibleRow

PrevRow

PrevVisibleRow

Remove

RestoreDefaults

RestoreFromIniFile

RestoreFromRegistry

RestoreFromStream

RowByCaption

RowByName

ShowEdit

ShowEditByKey

ShowEditByMouse

StoreToIniFile

StoreToRegistry

StoreToStream


Events for TcxVerticalGrid
TcxVerticalGrid Events

TcxVerticalGrid          Legend

Derived from TcxCustomVerticalGrid

OnDrawBackground

OnDrawRowHeader

OnDrawValue

OnItemChanged

OnLeftVisibleBandIndexChanged

OnLeftVisibleRecordIndexChanged

OnTopRowIndexChanged


TcxvgMultiRecordsOptionsBehavior
TcxvgMultiRecordsOptionsBehavior Object

Hierarchy          Properties

Contains settings determining the grid control’s response to user actions.

Unit

cxVGrid

TcxvgMultiRecordsOptionsBehavior = class(TcxvgOptionsBehavior)

Description

The TcxvgMultiRecordsOptionsBehavior class contains settings determining the grid controls response to the user actions: focusing cells by keyboard and mouse, pressing the Enter and Tab keys, activating inplace editors, etc.  It inherits all its properties from its ancestor and published the necessary ones.

Use OptionsBehavior property to access this set of options.


TcxvgMultiRecordsOptionsBehavior Hierarchy
Hierarchy

TcxControlOptionsBehavior

     |

TcxvgOptionsBehavior

     |


Properties for TcxvgMultiRecordsOptionsBehavior
TcxvgMultiRecordsOptionsBehavior Properties

TcxvgMultiRecordsOptionsBehavior          Legend

In TcxvgMultiRecordsOptionsBehavior

AllowChangeRecord

IncSearchItem

Derived from TcxvgOptionsBehavior

AlwaysShowEditor

BandSizing

HeaderSizing

RowSizing

RowTracking

Derived from TcxControlOptionsBehavior

CellHints

FocusCellOnCycle

FocusFirstCellOnNewRecord

GoToNextCellOnEnter

GoToNextCellOnTab

ImmediateEditor

IncSearch

IncSearchItem


TcxvgMultiRecordsOptionsBehavior.AllowChangeRecord

TcxvgMultiRecordsOptionsBehavior

Specifies whether scrolling through records is enabled.

property AllowChangeRecord: Boolean;

Description

The AllowChangeRecord property specifies whether the user can scroll records in the grid control. This property is in effect when the value of the TcxVirtualVerticalGrid.LayoutStyle is lsSingleRecordView or lsBandsView. If the value of the AllowChangeRecord property is True the user can scroll through records using the horizontal scrollbar or left arrow and right arrow keys.

Note: the user can only use the horizontal scrollbar to scroll records if the ssBoth or ssHorizontal flags on the TcxvgMultiRecordsOptionsView.ScrollBars property are active.

The default value of the AllowChangeRecord property is True.


TcxvgMultiRecordsOptionsBehavior.IncSearchItem

TcxvgMultiRecordsOptionsBehavior

Specifies the row against which an incremental search is performed.

property IncSearchItem: TcxCustomEditorRow;

Description

The incremental search feature (i.e. the IncSearch property is set to True) allows the user to locate a record by matching text. The IncSearchItem property specifies the row to apply incremental search. A user can find the desired record by typing the start of the required value. The cell containing the typed value will be located within the row and the corresponding record will be focused.


TcxvgMultiRecordsOptionsData
TcxvgMultiRecordsOptionsData Object

Hierarchy          Properties

Contains settings affecting the data-aware functionality of a vertical grid control.

Unit

cxVGrid

TcxvgMultiRecordsOptionsData = class(TcxControlOptionsData)

Description

The TcxMultiRecordsOptionsData object is used to determine which actions can be performed for the records within the current vertical grid control.  It determines whether record deletion is allowed (with/without confirmation) and whether empty records can be posted into a data set.

Use the control’s OptionsData property to access this set of options.


TcxvgMultiRecordsOptionsData Hierarchy
Hierarchy

TcxControlOptionsData

     |


Properties for TcxvgMultiRecordsOptionsData
TcxvgMultiRecordsOptionsData Properties

TcxvgMultiRecordsOptionsData          Legend

In TcxvgMultiRecordsOptionsData

Deleting

DeletingConfirmation

Inserting

Derived from TcxControlOptionsData

CancelOnExit

Editing


TcxvgMultiRecordsOptionsData.Deleting

TcxvgMultiRecordsOptionsData

Determines whether a user is allowed to delete records by pressing the Del or Ctrl+Del key.

property Deleting: Boolean;

Description

Use the Deleting property to determine whether a user is allowed to delete records within a view via pressing the Del or Ctrl+Del keys.

If this option is inactive records still can be deleted via code.  Consider the following code deleting the focused record:

//Delphi

cxDBVerticalGrid.DataController.DeleteRecord(cxDBVerticalGrid.FocusedRecordIndex);

The default value of the Deleting property is True.


TcxvgMultiRecordsOptionsData.DeletingConfirmation

TcxvgMultiRecordsOptionsData

Determines whether a message box appears requiring confirmation of the user’s request to delete a record.

property DeletingConfirmation: Boolean;

Description

Use the DeletingConfirmation property to determine whether the confirmation is required before deleting a record.  This option is in effect only when record is deleted by an end-user via pressing the Del or Ctrl+Del keys.

The default value of the DeletingConfirmation property is True.


TcxvgMultiRecordsOptionsData.Inserting

TcxvgMultiRecordsOptionsData

Determines whether a user can insert records by pressing the Insert key.

property Inserting: Boolean;

Description

Use the Inserting property to determine whether a user can insert records by pressing the Insert key.

The default value of the Inserting property is True.


Layouts Overview

Layout is the manner in which the vertical grid control will provide data. The main distinction of the vertical grid control from other grid controls is how it displays records. All records are arranged vertically in the vertical grid. In other words every column in the vertical grid represents a data record.

The ExpressVerticalGrid control supports 3 layouts:

•	Bands View Layout - only one record is available at a time in the grid control. The record will be rearranged into bands to occupy all of the client area of the grid control if the height of the grid control is insufficient to display the record height entirely. This type of layout is useful if you want all of the record’s fields to be visible in the grid control.

•	Single Record View Layout - only one record is available at a time in the grid control. If the height of the record doesn’t fit the control’s height the record will be clipped. This type of layout is useful if a record has a few fields to display;

•	Multiple Records View Layout - more than one record is available at a time in the grid control. This type of layout can be used if a record is not too large and you want to speed up navigation through records.

Detailed description’s of every layout is provided in separate topics that are referred to from this document.

Setting the layout

Setting the layout at design time or runtime.

To set the layout at design time use the Object Inspector as shown in the image below:

To set the layout at runtime use the TcxVirtualVerticalGrid.LayoutStyle property. The code below demonstrates 3 possible scenarios:

//Delphi

//...

cxDBVerticalGrid1.LayoutStyle := lsBandsView;

// or

cxDBVerticalGrid1.LayoutStyle := lsSingleRecordView;

// or

cxDBVerticalGrid1.LayoutStyle := lsMultiRecordView;


Bands View Layout

The Bands View Layout is used when only one record is available at a time in the grid control. The record will be rearranged into bands to occupy all the client area of the grid control if the height of the grid control is insufficient to display the record entirely. This type of layout is useful if you want all a record’s fields to be visible in the grid control.

The following image displays the vertical grid in the bands view layout:

The list below describes properties that control the bands view layout:

•	The TcxvgOptionsView.AutoScaleBands property specifies if the band fills the width of all the client area of the grid control. If this property is set to True the band’s width is stretched to all of the control’s width.

•	The TcxvgOptionsView.BandsInterval property specifies spacing between bands in pixels.

•	The TcxvgOptionsBehavior.BandSizing property specifies if the user can change the band’s width by dragging the right edge of the band (the TcxvgOptionsView.AutoScaleBands property should be set to False). If this property is set to True the user can resize the band’s width.


Single Record View Layout

The Single Record View Layout is used when only one record is available at a time in the grid control. If the height of the record doesn’t fit the control’s height the record will be clipped and the vertical scrollbar is displayed. This type of layout is useful if a record has a few fields to display.

The following image displays the vertical grid in the single record view layout:


Multiple Records View Layout

The Multiple Records View Layout is used when more than one record is available at a time in the grid control. This type of layout can be used if a record is not too large and you want to speed up navigation through records.

The following image displays the vertical grid in the multiple records view layout:

The following property controls the multiple records view layout:

•	The TcxvgMultiRecordsOptionsView.RecordsInterval property specifies spacing between data columns in pixels.


Paint Styles

Paint Style sets the base drawing style for the vertical grid. The ExpressVerticalGrid control supports two painting styles: the .NET painting style and Delphi painting style. These styles are defined in TcxvgPaintStyle:

//Delphi

TcxvgPaintStyle = (psdotNet, psDelphi);

.NET painting style	Delphi painting style

Note:	When the .NET painting style is applied the category row style is used to paint indents before each of its child rows.

Setting the paint style

Setting the paint style at design time and runtime.

To set the paint style at design time use the Object Inspector as shown in the image below:

To set the paint style at runtime the TcxvgOptionsView.PaintStyle property is used. The code below demonstrates two possible scenarios:

//Delphi

//...

//setting the .NET painting style

cxDBVerticalGrid1.OptionsView.PaintStyle := TcxvgPaintStyle(psdotNet);

//or

// setting the Delphi painting style

cxDBVerticalGrid1.OptionsView.PaintStyle := TcxvgPaintStyle(psDelphi);


Data Modes Overview

A data mode is the method the grid control uses to exchange data with the underlying data source, it depends on the type of data source the grid control connects to.

To make any view control independent of a data source there are a data layer components that are aware of how to handle data for the view control. For example, Delphi provides TDataSet data layer classes family to process different types of data source.

The vertical grid control supports two data modes:

•	Bound Mode

The cxDBVerticalGrid control is responsible for work in this mode. In the Bound Mode this type of vertical grid uses the TDataSet descendants to communicate with the underlying data. The cxDBVerticalGrid control then communicates with the TDataSet descendant using a sequence of classes - the TcxDBVerticalGridDataController class that manages interaction between the grid and a data layer and the standard TDataSource class that plays a role as conduit between the controller and dataset. Besides functionality mentioned above the TcxDBVerticalGridDataController adds implementation for comprehensive data processing. This class eases the task of configuring or implementing a connection with data at design time or runtime. For details please refer to the Bound Mode topic.

•	Provider Mode

The Provider Mode implies that the vertical grid communicates with a custom data source (for example, a flat file). A custom data source means that it is not possible to develop standard data layer classes beforehand for a given type of data source. For this purpose the cxVirtualVerticalGrid control was developed. It works with the TcxCustomDataSource class that defines base functionality for communication with a data source. You should implement the TcxCustomDataSource descendant and override at least three methods GetRecordCount, GetValue and SetValue to provide read-write operations for this mode. For details please refer to the Provider Mode topic.


Bound Mode

The Bound Mode implies that the vertical grid control connects to a data source which is represented by TDataSet descendants. The cxDBVerticalGrid control was developed to work in this mode, this control is represented by the TcxDBVerticalGrid class. Implementation of the Bound Mode is a simple task because the TcxDBVerticalGridDataController class was developed to work with this kind of data source. This class represents behavior that enables a developer to configure this grid control and retrieve data at design time or runtime in a few steps.

Below is an example on how to provide this mode at design time and runtime using the TDataSet descendant TADOTable class.

Binding to the data source at design time.

To connect the cxDBVerticalGrid control to the ADO table drag and drop the DataSource control onto a form (click the Data Access page tab in the Component Palette to get access to the control). Do the same with the ADOTable control residing in the ADO page of the Component Palette.

The Microsoft® Access CarsDB.mdb database will be used as the data source in this example. To map the TADOTable dataset to a data source select the ADOTable control on the form access the ADOTable control properties in the Object Inspector and give it the name "Cars".

To establish a connection between the dataset and data source set the TADOTable.ConnectionString property to string this will then be used to hold the information about the provider used and the database deployment path for this connection. To do this:

•	Click on the button to the right of the property and the ConnectionString wizard will appear:

•	Click the Use Connection String radio button and then click the Build… button to the right of the Use Connection String text field. The Data Link Properties window will appear. Click the Provider page tab and select Microsoft Jet 4.0 OLE DB Provider, then click the Next>> button or the Connection page tab to enter a path to the database name:

•	Check you have entered the correct path to the database name and then click the Test Connection button on the Connection page. If the connection is successful a message box like this will appear:

Then click on the OK button in all open windows to save the changes and return to the Object Inspector.

Now select the database table (in this example Cars) and set the TADOTable.Active property to True to populate the dataset with data from the mapped data source:

After which you can create rows and connect them to the corresponding fields in the database table, there is also an option to do this in bulk:

•	Double-click on the grid control or right-click on the grid control and select the Edit… item in the pop-up menu to invoke the Rows Collection Editor. Click the Create all items button in the Rows Collection Editor to create rows and populate them with data:

If you intend to have rows in a linear structure and no multi editor rows are required your vertical grid is ready to run:

Note: if you’d like to display and edit data in an appropriate fashion you need to bind a specific editor for the given type of data to every row. For details please refer to the Assigning Editors to Editor Rows topic.

Suppose you have a need to create rows step-by-step and connect every row to a corresponding field in a table. If the Rows Collection Editor window is opened click on the Add editor button to add just one editor row to the grid and give it a name of "ID":

Using the TcxDBVerticalGridItemDataBinding.FieldName property bind this row to the corresponding ID field of the Cars table:

The ID row is bound to the table field and populated with its data:

Repeat the same for other rows.

Note: the multi editor row is just a container for items that are responsible for binding to the corresponding table fields. For details please refer to the Multi Editor Rows topic.

Binding to the data source at runtime.

To populate the cxDBVerticalGrid control with data you’ll have to create rows and bind them to the corresponding fields of the database table as shown in this code snippet:

//Delphi

//...

with DBVerticalGrid.Add(TcxDBEditorRow) as TcxDBEditorRow do

      begin

        Properties.DataBinding.FieldName := 'ID';

        Name := 'ID';

        Caption := 'ID';

      end;

Here is a full example on how to create rows that map to the database table structure and populate the vertical grid with a data:

//Delphi

unit BoundModeDemoMain;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, cxStyles, cxGraphics, cxEdit, cxControls, cxInplaceContainer, cxVGrid, cxDBVGrid, DB, ADODB, cxClasses;

type

  TBoundModeDemoForm = class(TForm)

    DBVerticalGrid: TcxDBVerticalGrid;

    // don’t forget to configure the ADOTable dataset as described above in this topic

    DataSource: TDataSource;

    Cars: TADOTable;

    procedure FormCreate(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

var

  BoundModeDemoForm: TBoundModeDemoForm;

implementation

{$R *.dfm}

procedure TBoundModeDemoForm.FormCreate(Sender: TObject);

begin

   DBVerticalGrid.DataController.CreateAllItems;

end;

end.

Using the Object Inspector assign the TBoundModeDemoForm.FormCreate method to the BoundModeDemoForm OnCreate event to let the Delphi container call this method when the user launches the application.

The output when this code is running will be:


Provider Mode

To provide the ability to work with the custom data source (aka Provider Mode) the cxVirtualVerticalGrid control was developed. This control is represented by the TcxVirtualVerticalGrid class. This topic uses the Provider Mode Demo application shipped with this product as a base to describe the Provider Mode implementation.

The custom data source can be for example, a flat ASCII text file with the data tabulated (as for this example, named contacts.txt).

To work with the custom data source you should implement the TcxCustomDataSource descendant. In this example the descendant class named TCustomerDataSource is used. The TCustomerDataSource class overrides the following TcxCustomDataSource class methods:

•	GetRecordCount retrieves the number of records;

•	GetValue and SetValue – the former returns a value contained in a specified record field and the latter updates this value.

Consider simple Use Cases: the user launches the vertical grid, browses and edits the data in the grid and then closes the application.

Let’s classify these Use Cases into two activities sequences:

The first sequence:

When the user launches the application:

•	Load data from the flat file and cache it in a buffer;

•	Create rows in the vertical grid related to the underlying data structure;

•	Populate rows in the grid with data cached in the buffer.

Now the user can browse and edit data in the grid.

The second sequence:

When the user exits the application:

•	Update any changed data when the user closes the application;

•	Clean up after the application.

Let’s define classes that represent the buffer’s structure:

•	The TCustomer class represents the composite Value Object that corresponds to the record in the flat file and

•	The TCustomerList class represents the composite Value Object that corresponds to the flat file itself.

//Delphi

unit ProviderModeDemoLibrary;

interface

 {$I Demos.inc}

uses

  Classes, cxCustomData{$IFDEF DELPHI6}, Variants{$ENDIF};

const

  IndexOfID = 0;

  IndexOfName = 1;

  IndexOfCompany = 2;

type

  TCustomer = class

  private

    FID: Integer;

    FName: string;

    FCompany: string;

  public

    constructor Create(AID: Integer);

    // define a key that will be an identifier for every record

    property ID: Integer read FID write SetID;

    // create properties that map to the data sourse fields

    property Company: string read FCompany write FCompany;

    property Name: string read FName write FName;

  end;

TCustomerList = class

  private

    // define a field to represent the TList object where all data will be stored

    FList: TList;

    FNextID: Integer;

    // define cleaner

    procedure ReleaseAllCustomers;

    // read a record from the buffer

    function GetCustomer(AIndex: Integer): TCustomer;

    function GetCount: Integer;

  public

    constructor Create;

    destructor Destroy; override;

    // add a record to the end of the buffer collection

    function Add(Customer: TCustomer): Integer;

    // define a property to access the 2-dimensional array

    property Customers[Index: Integer]: TCustomer read GetCustomer;

             default;

    // define a property to know how many records there are in the buffer

    property Count: Integer read GetCount;

    // define a counter that will be used to assign an ID for every record

    property NextID: Integer read FNextID;

end;

Now define a class that will work with a custom data source:

// derive a class from the TcxCustomDataSource and define members that enable at the least reading from and writing to the underlying data

TCustomerDataSource = class(TcxCustomDataSource)

  private

    FCustomers: TCustomerList;

    FModified: boolean;

  protected

    // define how many records in a data source

    function GetRecordCount: Integer; override;

    // read the value from the record

    function GetValue(ARecordHandle: TcxDataRecordHandle;

         AItemHandle: TcxDataItemHandle): Variant; override;

    // write the value to the record

    procedure SetValue(ARecordHandle: TcxDataRecordHandle;

         AItemHandle: TcxDataItemHandle; const AValue: Variant);

         override;

  public

    constructor Create(ACustomerList: TCustomerList);

    // define a flag to check if the user has changed data when the application is about to be closed

    property Modified: boolean read FModified;

end;

Provide implementation for the interface defined:

implementation

{ TCustomer }

constructor TCustomer.Create(AID: Integer);

begin

  inherited Create;

  FID := AID;

end;

{ TCustomerList }

function TCustomerList.Add(Customer: TCustomer): Integer;

begin

  Result := FList.Add(Customer);

  Inc(FNextID);

end;

constructor TCustomerList.Create;

begin

  inherited Create;

  FList := TList.Create;

  FNextID := 1;

end;

destructor TCustomerList.Destroy;

begin

  ReleaseAllCustomers;

  FList.Free;

  inherited Destroy;

end;

function TCustomerList.GetCount: Integer;

begin

  Result := FList.Count;

end;

function TCustomerList.GetCustomer(AIndex: Integer): TCustomer;

begin

  Result := TCustomer(FList[AIndex]);

end;

procedure TCustomerList.ReleaseAllCustomers;

var

  I : Integer;

begin

  for I := 0 to Count -1 do

    TCustomer(FList[I]).Free;

  FList.Clear;

end;

{ TCustomerDataSource }

constructor TCustomerDataSource.Create(ACustomerList: TCustomerList);

begin

  inherited Create;

  FCustomers := ACustomerList;

end;

function TCustomerDataSource.GetRecordCount: Integer;

begin

  Result := FCustomers.Count;

end;

function TCustomerDataSource.GetValue(ARecordHandle:

  TcxDataRecordHandle; AItemHandle: TcxDataItemHandle): Variant;

var

  AColumnId: Integer;

  ACustomer: TCustomer;

begin

  ACustomer := FCustomers[Integer(ARecordHandle)];

  AColumnId := GetDefaultItemID(Integer(AItemHandle));

  case AColumnId of

    IndexOfID:

      Result := ACustomer.ID;

    IndexOfName:

      Result := ACustomer.Name;

    IndexOfCompany:

      Result := ACustomer.Company;

  end;

end;

procedure TCustomerDataSource.SetValue(ARecordHandle:

  TcxDataRecordHandle; AItemHandle: TcxDataItemHandle; const AValue:

  Variant);

var

 ACustomer: TCustomer;

 AColumnId: Integer;

begin

  AColumnId := GetDefaultItemID(Integer(AItemHandle));

  ACustomer := FCustomers[Integer(ARecordHandle)];

  case AColumnId of

    IndexOfID:

      if VarIsNull(AValue) then

        ACustomer.ID := 0

      else

        ACustomer.ID := AValue;

    IndexOfName:

      ACustomer.Name := VarToStr(AValue) ;

    IndexOfCompany:

      ACustomer.Company := VarToStr(AValue);

  end;

  if not Modified then

    FModified := True;

end;

end.

Now let’s define the main unit where the activities mentioned above will take place:

unit ProviderModeDemoMain;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, cxStyles, cxGraphics, cxEdit, cxClasses, cxVGrid, cxControls, cxInplaceContainer, cxDataStorage;

type

  TProviderModeDemoForm = class(TForm)

    VirtualVerticalGrid: TcxVirtualVerticalGrid;

    procedure FormCreate(Sender: TObject);

    procedure FormDestroy(Sender: TObject);

    procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);

  private

    procedure GenerateRows;

    procedure LoadData;

    procedure SaveData;

  public

    { Public declarations }

  end;

var

  ProviderModeDemoForm: TProviderModeDemoForm;

implementation

uses ProviderModeDemoLibrary;

{$R *.dfm}

const

  TabChar = #9;

var

  CustomerList : TCustomerList;

procedure TProviderModeDemoForm.GenerateRows;

begin

  with VirtualVerticalGrid do

  begin

    ClearRows;

    with AddChild(nil, TcxEditorRow) as TcxEditorRow do

    begin

      Properties.Caption := 'ID';

      Properties.DataBinding.ValueTypeClass := TcxIntegerValueType;

    end;

    with AddChild(nil, TcxEditorRow) as TcxEditorRow do

    begin

      Properties.Caption := 'Name';

      Properties.DataBinding.ValueTypeClass := TcxStringValueType;

    end;

    with AddChild(nil, TcxEditorRow) as TcxEditorRow do

    begin

      Properties.Caption := 'Company';

      Properties.DataBinding.ValueTypeClass := TcxStringValueType;

    end;

  end;

end;

procedure TProviderModeDemoForm.LoadData;

var

  ACustomer: TCustomer;

  I: Integer;

  s: string;

begin

   CustomerList := TCustomerList.Create;

   with TStringList.Create do

   try

     LoadFromFile('contacts.txt'); // make sure the path is correct and the file is in the directory specified

     for I := 0 to Count - 1 do

     begin

       ACustomer := TCustomer.Create(CustomerList.NextID);

       s := Strings[I];

       ACustomer.Name := Copy(s, 1, Pos(TabChar, s) - 1);

       ACustomer.Company := Copy(s, Pos(TabChar, s) + 1, Length(s));

       CustomerList.Add(ACustomer);

     end;

   finally

     Free;

   end;

end;

procedure TProviderModeDemoForm.SaveData;

var

  ACustomer: TCustomer;

  I: Integer;

begin

  with TStringList.Create do

  try

    for I := 0 to CustomerList.Count - 1 do

    begin

       ACustomer := CustomerList.Customers[I];

       Add(ACustomer.Name + TabChar + ACustomer.Company);

    end;

    SaveToFile('contacts.txt'); // make sure the path is correct

  finally

    Free;

  end;

end;

procedure TProviderModeDemoForm.FormCreate(Sender: TObject);

begin

  LoadData;

  GenerateRows;

// aggregate the buffer with the TCustomerDataSource object

  VirtualVerticalGrid.DataController.CustomDataSource := TCustomerDataSource.Create(CustomerList);

  VirtualVerticalGrid.LayoutStyle := lsMultiRecordView;

end;

// don’t waste memory, destroy all associated  objects when closing.

procedure TProviderModeDemoForm.FormDestroy(Sender: TObject);

begin

  VirtualVerticalGrid.DataController.CustomDataSource.Free;

  CustomerList.Free;

end;

//bring up a message box and ask the user whether to update the data changed

procedure TProviderModeDemoForm.FormCloseQuery(Sender: TObject;  var CanClose: Boolean);

var

  I: Integer;

begin

  I := -1;

  if TCustomerDataSource(cxVirtualVerticalGrid1.DataController.

CustomDataSource).Modified then

I := MessageDlg('Do you want to save changes ?', mtConfirmation, [mbYes, mbNo, mbCancel], 0);

   case I of

    mrYes: SaveData;

    mrCancel: CanClose := False;

   end;

end;

end.

Now using the Object Inspector assign the last three methods as event handlers to the ProviderModeDemoForm events: TProviderModeDemoForm.FormCreate to the OnCreate event to allow the Delphi container to call this method when the user launches the application, TProviderModeDemoForm.FormDestroy to the OnDestroy event and TProviderModeDemoForm.FormCloseQuery to the OnCloseQuery event to call these methods when the user exits the application.

To feel this code in action play with our demo shipped with this product. If everything is working correctly the output will look like this:


Creating A Tree-like Structure Of Rows

Rows of all types can hold a collection of child rows. Thus data in the ExpressVerticalGrid can be organized into a tree-like structure in which parent rows can be expanded and collapsed to show and hide their children. This topic explains how to organize rows in such a hierarchical manner.

Tree structure overview.

Organizing rows into a tree increases data readability, facilitates data searching and the rearrangement of rows. Consider the following cases where a tree of rows is likely to be used:

•	Data displayed by rows is hierarchical by nature. For instance, if rows in your control display a person’s details, it is natural to display a row showing the person's name as the parent row and rows which display the individual’s details (title, hire date, dob, etc) as child rows.

•	Arranging data into a tree enables you to show only a subset of the most commonly used fields at application start-up. End users will be enabled to expand rows to see details that are rarely required. This will allow you to use the screen space more efficiently by displaying less rows at a time.

•	Parent and child rows are kept together. If a parent row is moved either to another position within the grid or to the customization form, its child rows are moved with it.

The image below displays an example of arranging the rows of the vertical grid into a tree.

At the object level, rows are organized into nesting collections to represent the tree. Rows of any kind (both parents and children) are stored in the TcxVerticalGridRows collection which is represented by the TcxCustomVerticalGrid.Rows property. Every row can hold a collection of child rows of any type which is represented by the TcxCustomRow.Rows property. The child rows can also have their own children and so on.

Creating a tree at design time.

At design time rows can be arranged into a tree using the Layout Editor to do this you need to perform only simple drag & drop operations to arrange the rows into a tree. The following drag & drop operations are available:

•	Drag the source row over the row indent to insert the source row before the target row (the same level).

Note: to invoke the Layout Editor double-click on the grid control, the Rows Collection Editor will appear then click on the Layout editor… button and the Layout Editor will appear. As an alternative you can right-click on the grid control. When the pop-up menu appears, select the Layout Editor… item.

•	Drag the source row over the target row header to move the source row into the child collection of the target row.

You can also use the Customization Form to rearrange rows, to invoke it click on the Customize button within the Layout Editor.

Creating a tree at runtime.

Two scenarios are possible: rearranging the rows created before or building a tree from scratch.

The first example shown below assumes that the rows were created before their rearrangement. This example will result in the same layout as indicated above (Creating a tree at design time subtopic).

//Delphi

//...

//move the ID editor row to the first position at the same level within the grid control

fldID.Index := 0;

//...

//add the HP editor row to the collection of the Performance Attributes category row and put it first in the collection

fldHP.Parent := rowPerformance_Attributes;

fldHP.Index := 0;

Note: if you need to move the desired row from the child collection to the top level implement an operation similar to the following:

//Delphi

//...

fldHP.Parent := nil;

//the HP row will be moved to the end of the top level

You can enable the user to rearrange rows at runtime without the code listed above if you provide the user with the Customization Form. The Customization Form allows the user to rearrange rows within the grid control or within itself by dragging the desired rows into the form.

To invoke the Customization Form set the TcxVerticalGridCustomizing.Visible property to True, as shown in the code snippet below:

//Delphi

//...

cxDBVerticalGrid.Customizing.Visible := True;

To build a new tree use the TcxCustomVerticalGrid.Add and TcxCustomVerticalGrid.AddChild methods. The first method puts the created row at the top level while the second adds a row into the child collection of the specified parent. The constructed tree is sorted according to the method invocation order.

//Delphi

//...

rowPerformance_Attributes := cxDBVerticalGrid.Add(TcxCategoryRow);

 with rowPerformance_Attributes do

    begin

    Properties.Caption := 'Performance Attributes';

    //...

 end;

//add the HP child row to the Performance Attributes row collection

fldHP := TcxEditorRow(cxDBVerticalGrid.AddChild(rowPerformance_Attributes, TcxEditorRow));

  with fldHP do

    begin

    Properties.Caption := 'HP';

    //...

  end;

//add the Liter child row to the Performance Attributes row collection

fldLiter := TcxEditorRow(cxDBVerticalGrid.AddChild(rowPerformance_Attributes, TcxEditorRow));

  with fldLiter do

    begin

    Properties.Caption := 'Liter';

    //...

  end;

//...


Accessing Rows

Obtaining an object that represents the desired row is the usual task when using the ExpressVerticalGrid control. This can then be used to modify the desired row's settings or to pass the row object as a parameter to some methods.

Accessing a specific row.

To access the desired row you can use its name or caption, which were set in the Object Inspector at design time or that have been assigned at runtime. To retrieve the desired row object use either the TcxCustomVerticalGrid.RowByName or TcxCustomVerticalGrid.RowByCaption methods. They assume that the row name or caption has a unique value since these methods find the first occurrence of the search value.

If due to some reason you can’t use the row name or caption the TcxCustomVerticalGrid.Rows or TcxCustomRow.Rows properties could be used to get the row object.

//Delphi

//...

//hide the Liter row

  with cxDBVerticalGrid.Rows do

   Items[fldLiter.AbsoluteIndex].Visible := False;

They can also be used in loops or if the row object is anonymous. Consider the following example:

//Delphi

//...

var I: Integer;

begin

  with cxDBVerticalGrid do

    begin

     for I := 0 to Rows.Count - 1 do

      begin

      if (Rows.Items[I] is TcxCategoryRow) then

         Rows.Items[I].Collapse(True);

      end;

    end;

end;

In this example all category rows are subsequently collapsed along with their subtrees.

Other means of getting rows.

The ExpressVerticalGrid provides direct access to the currently focused row. Read the TcxCustomVerticalGrid.FocusedRow property to get the row object.

There are also a number of methods that allow the retrieval of row objects in both directions, relative to the specified row (it’s natural to use these methods in connection with the focused row) or for retrieving the first and last rows:

•	TcxCustomVerticalGrid.NextRow returns the row next to the specified row;

•	TcxCustomVerticalGrid.PrevRow returns the row followed by the specified row;

•	TcxCustomVerticalGrid.FirstRow returns the first row in the grid;

•	TcxCustomVerticalGrid.LastRow returns the last row in the grid;

•	TcxCustomVerticalGrid.NextVisibleRow returns the next visible row to the specified row;

•	TcxCustomVerticalGrid.PrevVisibleRow returns the previous visible row to the specified row.

•	TcxCustomVerticalGrid.FirstVisibleRow returns the first visible row in the grid;

•	TcxCustomVerticalGrid.LastVisibleRow returns the last visible row in the grid.

When all rows are visible these two sets of methods return the same values, as illustrated in the image below.

The next image shows the same vertical grid control where the 'Power' and 'Picture' rows are invisible (they are displayed in the Customization Form). In this case the methods will return different values.


Scrolling And Focusing Rows

Scrolling rows.

If the number of rows is too large to fit into the grid control the user can scroll the grid vertically using the vertical scroll bar to access the desired row. Or you can make the desired row available for the user programmatically.

Use the TcxCustomRow.MakeVisible method to scroll vertically.

When invoked on the child row object this method expands its parent(s) that were collapsed and scrolls the view to make this row visible within the vertical grid boundaries.

Another way to scroll the grid vertically is assigning the TcxCustomVerticalGrid.TopVisibleRowIndex property the TcxCustomRow.AbsoluteIndex desired row property value. This property doesn’t cause the desired row’s parents to expand.

//Delphi

//...

//expand the Price row parents and scroll the vertical grid

fldPrice.MakeVisible;

// or

// just scroll the vertical grid

cxDBVerticalGrid.TopVisibleRowIndex := fldPrice.AbsoluteIndex;

Moving focus between rows.

The ExpressVerticalGrid enables users to move focus from row to row using either the mouse or keyboard. You can facilitate the user to move focus to the desired row by assigning the TcxCustomVerticalGrid.FocusedRow property to the desired row object reference.

//Delphi

//...

// make sure the value of the fldPrice.Options.Focusing is True and move focus to the Price row

cxDBVerticalGrid.FocusedRow := fldPrice;

Note: the TcxCustomRow.Options.Focusing property should be set to True. Otherwise the desired row doesn’t get focus.


Expanding And Collapsing Rows

Every row in the ExpressVerticalGrid control can have a number of child rows, so rows can be expanded and collapsed to show and hide their children respectively.

You can set the expanding state at design time or runtime.

Setting expanding state at design time.

To set the default expanding state that the desired row has, the first time the user runs the application use the TcxCustomRow.Expanded property in the Object Inspector.

If you set this property to True the desired row will be expanded. Otherwise it will be collapsed.

Setting expanding state at runtime.

To expand or collapse the desired row at runtime you can use three members of the TcxCustomRow class: the TcxCustomRow.Expanded property and the TcxCustomRow.Expand / TcxCustomRow.Collapse methods.

Assigning the TcxCustomRow.Expanded property True or False values is similar to invoking the TcxCustomRow.Expand and TcxCustomRow.Collapse methods respectively.

Note: there is one exception for this property, it is not possible to expand or collapse all of the subtrees of the row, where as with the mentioned methods if they are provided with the True argument all of the subtrees of the desired row will be expanded or collapsed.

//Delphi

//...

// Expand or collapse the desired row without expanding or collapsing its subtrees

rowPerformance_Attributes.Expanded := True; //or

rowPerformance_Attributes.Expand(False);  // the same behavior

//...

rowPerformance_Attributes.Expanded := False; //or

rowPerformance_Attributes.Collapse(False);  // the same behavior

// Expand or collapse the desired row along with expanding or collapsing its subtrees

rowPerformance_Attributes.Expand(True);

//or

rowPerformance_Attributes.Collapse(True);

Besides the  row members there are two more methods for the vertical grid object  TcxCustomVerticalGrid.FullExpand and TcxCustomVerticalGrid.FullCollapse you can use for bulk operations that is all parents at any level will be expanded or collapsed.

//Delphi

//...

// Expand or collapse all of the parent rows in the grid

cxDBVerticalGrid.FullExpand;

cxDBVerticalGrid.FullCollapse;


Rows Overview

The ExpressVerticalGrid control represents data by means of rows. This topic describes the types of rows available in the vertical grid control and lists their common features.

Row types.

There are three row types available in the ExpressVerticalGrid control:

•	Category Rows

Category rows are used to organize logically related rows into groups. This type of rows represents no data. The Category row is comprised of one header cell and provides descriptive information about a group of related rows.

•	Editor Rows

Editor Rows are used to display and edit data items. Editor Rows are formatted in the following manner: one header cell in a header column and one data cell in a data column.

The header cell contains descriptive information about the row while the data cell is a container for a data item.

•	Multi Editor Rows

Multi Editor Rows are used to display and edit a group of logically related data items. Multi Editor Rows have the following format, a set of header cells in a header column and a set of data cells in a data column.

The header cell contains descriptive information about the item, while the data cell is a container for a data item where this item is displayed and edited.

Row settings.

All rows have a common ancestor the TcxCustomRow class that encapsulates common settings for every type of row. The image below shows the Object Inspector with these settings highlighted.

Settings specific to every type of row are stored in separate objects. Please refer to the Row Properties topic for details.


Row Class Structure

One of the responsibilities of the ExpressVerticalGrid control is to provide a view of the underlying data to the user, structurally it arranges data into rows. The vertical grid is made up of any number of rows depending on how you design it. Each row in turn is formed by one or more cells that are differentiated into header and data cells. The header cell contains descriptive information about the row, the data cell acts as a container for a data item.

Depending upon how the data is arranged in rows and how the vertical grid interacts with them different types of rows are defined.

From the conceptual perspective there is one Row super type and three subtypes for the Row super type:

•	Row – this is a super type. Represents the base interface.

•	Category Row – this is a subtype of the Row. Comprised of one header cell, contains no data and serves to organize logically related rows into groups;

•	Editor Row – this is a subtype of the Row. Comprised of one header cell in a header column and a set of data cells with one per data column;

•	Multi Editor Row – this is a subtype of the Row. Comprised of a set of header cells in a header column and a set of data cells in a data column. This type is used to group logically related data items.

From the specification perspective every type of row is represented by the appropriate class:

•	TcxCustomRow – is an abstract class which represents the Row supertype and introduces the base interface and common behavior for the row family;

•	TcxCategoryRow represents the Category Row subtype;

•	TcxCustomEditorRow represents the Editor Row subtype;

•	TcxCustomMultiEditorRow represents the Multi Editor Row subtype.

The row’s hierarchy structure is shown in the following Class diagram:

The vertical grid uses the TcxCustomRow type as a common interface to interact with different types of rows. It enhances application robustness as well as easing its maintenance and custom development.

The relationship between the vertical grid and its rows is shown in the following image:


Row Properties

The TcxCustomRow family classes encapsulate the core row behavior. For code clarity and enhanced code management all functionality that defines row appearance and its interaction with different grid components is delegated to the TcxCustomRowProperties family.

The following types of row properties are defined for the appropriate types of rows:

•	Caption Row Properties – responsible for customizing the appearance of the editor row header and the Category Row since this type of row provides descriptive information and doesn’t work with data. Represented by the TcxCaptionRowProperties class;

•	Editor Row Properties – inherits behavior from the Caption Row Properties for its header and provides behavior for displaying and editing data items. Represented by the TcxEditorRowProperties class;

•	Multi Editor Row Properties – provides layout behavior for a group of logically related data items. The Multi Editor Row is composed of a set of data cells (that contain data items) in a data column and an appropriate set of header cells in a header column. Represented by the TcxMultiEditorRowProperties class;

•	Editor Row Item Properties – implements the display and editing of data items in the Multi Editor Row. Represented by the TcxEditorRowItemProperties class.

To get access from a row to its properties the Properties property is used.

The following Class diagram demonstrates the relationship between rows and their properties.


Category Rows

Category Rows are used to organize logically related rows into groups. The Category Row is comprised of one header cell and provides descriptive information about a group of related rows.

In the case of organizing related rows into categories they must be added to the corresponding category rows as children. If this is performed end users can expand and collapse category rows at runtime, thus showing and hiding rows belonging to a specific category. This allows you to provide a more representative look and feel for the vertical grid control and facilitates searching.

The image below displays the expanded and collapsed category.

Note: Category Rows do not necessarily reside at the first level within the grid control. They can also be child rows of other rows. You can provide sub-categories within a category, for instance. Please refer to the Creating A Tree-like Structure Of Rows topic for details on how to implement hierarchical row structures within a vertical grid.

Features of Category Rows.

Settings that manage the Category Row (represented by the TcxCategoryRow class) can be divided into four groups. The following classes represent these groups:

1.	The TcxCustomRow class provides properties common to all types of rows published in its subclasses including the properties TcxCategoryRow.Properties and TcxCategoryRow.Styles that represent settings custom to the Category Row.

2.	The TcxRowOptions class provides options common to all types of rows. The TcxCategoryRow.Options property references the TcxRowOptions object.

3.	The TcxCaptionRowProperties class provides settings that define the behavior of the Category Row. The TcxCategoryRow.Properties property references the TcxCaptionRowProperties object.

4.	The TcxCategoryRowStyles class provides style settings. The TcxCategoryRow.Styles property references the TcxCategoryRowStyles object.

Note: the TcxvgOptionsView.CategoryExplorerStyle property of the Boolean type has influence on the Category Row style. You have a choice to paint the Category Row in XP style (if Windows XP is used) or tree view like style. Assign this property the True value to paint the Category Row in XP style. In this case the TcxCategoryRowStyles.Header settings will be overridden.

If you prefer tree-like view style set this property to False.

The following image demonstrates the settings of Category Rows in the Object Inspector at design time:


Editor Rows

Editor Rows are used to display and edit data items. Editor Rows are formatted in the following manner: one header cell in a header column and one data cell in a data column.

The header cell contains descriptive information about the row while the data cell is a container for a data item.

Features of Editor Rows.

Settings that manage the Editor Row (represented by the TcxCustomEditorRow class) fall into four groups. The following classes represent these groups:

1.	The TcxCustomRow class provides properties common to all the types of rows published in its subclasses while the TcxEditorRow.Properties property represents settings custom to the Editor Row.

2.	The TcxRowOptions class provides options common to all types of rows. The TcxEditorRow.Options property references the TcxRowOptions object.

3.	The TcxCustomEditorRowProperties class provides settings inherited from the TcxCaptionRowProperties and settings it implements that define the Editor Row behavior. The most important properties TcxCustomEditorRowProperties.EditProperties (and TcxCustomEditorRowProperties.EditPropertiesClass) or TcxCustomEditorRowProperties.RepositoryItem are used to assign the appropriate data item editor and customize its settings. See a detailed description on this theme in the Assigning Editors to Editor Rows topic. The TcxEditorRow.Properties property references the TcxCustomEditorRowProperties object.

4.	The TcxEditorRowStyles class provides style settings inherited from the TcxCategoryRowStyles class and implemented in its own. The TcxEditorRow.Styles property references the TcxEditorRowStyles object.

The following image demonstrates the settings of Editor Rows in the Object Inspector at design time:


Multi Editor Rows

Multi Editor Rows are used to display and edit a group of logically related data items. Multi Editor Rows have the following format: a set of header cells in a header column and a set of data cells in a data column.

The header cell contains descriptive information about the item while the data cell is a container for a data item where this item is displayed and edited.

Features of Multi Editor Rows.

Settings that manage the Multi Editor Row (represented by the TcxCustomMultiEditorRow class) fall into four groups. The following classes represent these groups:

1.	The TcxCustomRow class provides properties common to all the types of rows published in its subclasses while the TcxMultiEditorRow.Properties property represents settings custom to the Multi Editor Row.

2.	The TcxRowOptions class provides options common to all types of rows. The TcxMultiEditorRow.Options property references the TcxRowOptions object.

3.	The TcxMultiEditorRowProperties class provides settings inherited from the TcxCustomRowProperties class and settings it implements that define the Multi Editor Row behavior. The most important property, TcxMultiEditorRowProperties.Editors is used to assign an item to the Multi Editor Row. See the description on Multi Editor Row items in this topic below. The TcxMultiEditorRow.Properties property references the TcxMultiEditorRowProperties object.

4.	The TcxEditorRowStyles class provides style settings inherited from the TcxCategoryRowStyles class and implemented in its own. The TcxMultiEditorRow.Styles property references the TcxEditorRowStyles object.

The following image demonstrates the settings of Multi Editor Rows in the Object Inspector at design time:

Multi Editor Row items.

An item in the Multi Editor Row is used to display and edit an underlying data item. The TcxEditorRowItemProperties class represents the Multi Editor Row item, this class provides editing capabilities for a data item. As mentioned above the Multi Editor Row is a container for a group of logically related items. The TcxMultiEditorRowProperties.Editors property represents a collection where all items for the specified Multi Editor Row are cached.

Creating items at design time.

To create or get access to the item at design time follow these steps:

1.	Click on the button for the Editors property or double-click on this property in the Object Inspector. The editor properties collection editor window appears, click on the Add New (Ins) icon in the toolbar to create an item. Now settings of the newly created item are available in the Object Inspector. Name the TcxEditorRowItemProperties.Caption property "MPG City".

2.	Assign the underlying data item to this item. In this case use the TcxDBVerticalGridItemDataBinding.FieldName property to bind the MPG_City field of the Cars database in the Cars table, which is shipped with demo applications. Note that you must have a database connection ready. For more details on how to configure a data-aware vertical grid please refer to the Bound Mode topic.

3.	If you need a specific editor to display and edit the item’s values you can specify one using the TcxDBEditorRowItemProperties.EditProperties property as shown below:

See also Assigning Editors To MultiEditor Rows for more detailed explanations. The default editor will be assigned if you skip the third step.

Repeat the steps mentioned above for the MPG Highway item, except invoking the Editor properties collection editor if you did not close the Editor properties collection editor window.

If everything is working okay, you should have something that looks like this:

Creating items at runtime.

The following code snippet creates items with the TcxMultiEditorRow object within the TcxVerticalGrid:

//Delphi

//...

// Create the MPG City item, define type for data item and assign appropriate editor

with MultiEditorRow1.Properties.Editors.Add do

    begin

        DataBinding.ValueTypeClass := TcxIntegerValueType;

        EditPropertiesClass := TcxSpinEditProperties;

        Value := 16;

  	  Caption := 'MPG City';

    end;

//...

// Create the MPG Highway item, define type for data item and assign appropriate editor

with MultiEditorRow1.Properties.Editors.Add do

    begin

        DataBinding.ValueTypeClass := TcxIntegerValueType;

        EditPropertiesClass := TcxSpinEditProperties;

        Value := 23;

  Caption := 'MPG Highway';

    end;

When running this code the output will be:

When creating items for the TcxDBVerticalGrid you have to map an item to the database table field:

//Delphi

//...

// Bind the MPG City item to the MPG_City database table field and assign appropriate editor

with DBMultiEditorRow1.Properties.Editors.Add do

    begin

       DataBinding.FieldName := 'MPG_City';

 EditPropertiesClass := TcxSpinEditProperties;

       Caption := 'MPG City';

    end;


Implementing Custom Property Editor

The Delphi IDE provides an Object Inspector to edit the values of published properties at design time for the components placed on a form.

The purpose of the cxRTTIInspector control is the same as for the IDE Object Inspector but for runtime.

To bind the cxRTTIInspector runtime object inspector to the desired component at runtime use the TcxRTTIInspector.InspectedObject property as shown in the code snippet below:

// Delphi

//...

RTTIInspector.InspectedObject := DBVerticalGrid;

When applied the user can browse and edit the values of the published properties of the bound component at runtime:

The runtime object inspector enables the editing of properties values as defined by the TcxPropertyEditor descendants for the appropriate types of properties. You can provide your own alternate editor for specific properties by implementing and registering the TcxPropertyEditor descendant.

The example below shows how to implement a combo box editor for selecting the image index in the row header. This example is based on the ExpressVerticalGrid RTTIInspector Demo shipped with this product.

First define the image index editor represented by the TcxImageIndexProperty class, which is derived from the TcxPropertyEditor family. Override the following inherited methods to provide the proper behavior:

•	AdjustInnerEditProperties – this is a protected method of the TcxPropertyEditor class and is responsible for customizing the editing properties;

•	SetValue specifies the edited property value.

Define a new virtual method GetImages to provide the image list of the bound component, this method can be overridden by TcxImageIndexProperty descendants.

Register the TcxImageIndexProperty editor with the cxRegisterPropertyEditor and cxRegisterEditPropertiesClass procedures. The former procedure creates association between the property editor, the property type and the latter creates association between the property editor and the editor properties.

// Delphi

unit ImageIndexPropertyEditor;

interface

uses cxOI, cxEdit, ImgList, cxImageComboBox, Controls;

type

  TcxImageIndexProperty = class(TcxIntegerProperty)

  public

    procedure AdjustInnerEditProperties(AProperties: TcxCustomEditProperties); override;

    // override GetImages function in descendant to provide another image list

    function GetImages: TImageList; virtual;

    procedure SetValue(const Value: string); override;

  end;

implementation

uses SysUtils, cxVGrid;

resourcestring

  sNoImage = 'no image';

{ TcxImageIndexProperty }

procedure TcxImageIndexProperty.AdjustInnerEditProperties(

  AProperties: TcxCustomEditProperties);

var

  i: Integer;

  AComboBoxItem: TcxImageComboBoxItem;

  AImageComboBoxProperties: TcxImageComboBoxProperties;

  AImages: TImageList;

  procedure AssignImages;

  begin

    if AImages.Height = 16 then

      AImageComboBoxProperties.Images := AImages

    else

      AImageComboBoxProperties.LargeImages := AImages

  end;

  function GetImageList: TImageList;

  begin

    if AImageComboBoxProperties.Images <> nil then

      Result := AImageComboBoxProperties.Images

    else

      Result := AImageComboBoxProperties.LargeImages;

  end;

begin

  AImageComboBoxProperties := AProperties as TcxImageComboBoxProperties;

  AImages := GetImages;

  if AImages <> nil then

  begin

    AssignImages;

    AImageComboBoxProperties.Items.Clear;

    for i:= 0 to GetImageList.Count - 1 do

    begin

      AComboBoxItem := AImageComboBoxProperties.Items.Add as TcxImageComboBoxItem;

      AComboBoxItem.ImageIndex := i;

      AComboBoxItem.Value := i;

      AComboBoxItem.Description := IntToStr(i);

    end;

  end;

  AComboBoxItem := AImageComboBoxProperties.Items.Add as TcxImageComboBoxItem;

  AComboBoxItem.ImageIndex := -1;

  AComboBoxItem.Value := Integer(-1);

  AComboBoxItem.Description := sNoImage;

end;

procedure TcxImageIndexProperty.SetValue(const Value: string);

begin

  if Value = sNoImage then

    SetOrdValue(-1)

  else inherited SetValue(Value);

end;

function TcxImageIndexProperty.GetImages: TImageList;

begin

  Result := nil;

  if GetComponent(0) is TcxCaptionRowProperties then

  // it assumes the image list is bound at design time

     Result := TcxCaptionRowProperties (GetComponent(0)).Row.VerticalGrid.Images;

end;

initialization

cxRegisterPropertyEditor(TypeInfo(TImageIndex), TcxCaptionRowProperties, 'ImageIndex', TcxImageIndexProperty);  cxRegisterEditPropertiesClass(TcxImageIndexProperty, TcxImageComboBoxProperties);

end.

Now there is the main unit where the TcxDBVerticalGrid and TcxRTTIInspector objects are defined. Two rows – the PerformanceAttributes category row and the HP editor row - will be the inspected components in this application.

Just one method, the DBVerticalGridClick, is defined. It binds a row that gets focus to the runtime object inspector.

unit RTTIInspectorDemoMain;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, cxStyles, cxGraphics, cxEdit, cxVGrid, cxOI, cxControls, cxInplaceContainer, cxDBVGrid, DB, ADODB, ImgList, cxClasses, StdCtrls, cxDropDownEdit, cxContainer, cxTextEdit, cxMaskEdit, cxImageComboBox;

type

  TRTTIInspectorForm = class(TForm)

    DBVerticalGrid: TcxDBVerticalGrid;

    RTTIInspector: TcxRTTIInspector;

    DataSource: TDataSource;

    Cars: TADOTable;

    ImageList: TImageList;

    PerformanceAttributes: TcxCategoryRow;

    HP: TcxDBEditorRow;

    procedure DBVerticalGridClick(Sender: TObject);

 private

     { Private declarations }

 public

    { Public declarations }

 end;

var

  RTTIInspectorForm: TRTTIInspectorForm;

implementation

{$R *.dfm}

// using the Object Inspector assign this method at design time to the DBVerticalGrid OnClick event as an event handler

procedure TRTTIInspectorForm.DBVerticalGridClick(Sender: TObject);

begin

  RTTIInspector.InspectedObject := DBVerticalGrid.FocusedRow;

end;

end.

Here is the output for the code listed above:


Data Export

The ExpressVerticalGrid allows data to be exported to a number of different formats. Currently MS Excel, HTML, text and XML formats are supported. The MS Excel, HTML and XML formats reflect the appearance of the data in the grid control, while text format only preserves the data and its arrangement.

The following routines export data into the formats mentioned:

•	cxExportVGToExcel

•	cxExportVGToHTML

•	cxExportVGToText

•	cxExportVGToXML

Note: when the ExpressVerticalGrid is in Grid Mode (the value of the DBVerticalGridDataController.GridMode property is True) records that are currently cached (as specified by the DBVerticalGridDataController.GridModeBufferCount property) will be exported. If the value of the DBVerticalGridDataController.GridMode property is False all records will be exported.


The Repository Concept

The ExpessVerticalGrid control enables you to assign editors to data cells.  This allows you to represent cell values in a more readable form and facilitates modifying or entering data.

When a vertical grid control is connected to a data storage, its rows are assigned default editors according to the data field type.  The correspondence of field types to default editors is presented in the cxEditDBRegisteredRepositoryItems unit.  You can change the default editors to assign via the DBRepositoryItemClasses array.

If a default editor does not suite your needs, you can explicitly assign an appropriate editor.  Assignment of an editor to an item can be done in two ways: via the repository mechanism and by using the editor properties class.  This topic describes using the editors repository.

The editors repository functionality is encapsulated in the TcxEditRepository component.  This component provides a storage of repository items, each of which defines properties of a particular editor.  TcxEditRepository provides repository items for every editor within the ExpressEditorsLibrary.

The main advantage of the repository technology is that a repository item can be assigned to multiple rows of the same data type, and not only that, a single repository item can be used within all Developer Express products concerned with data editing.

The following steps describe how to assign a repository item to a vertical grid row.

1.	Drop a TcxEditRepository component on a form.  Double click it to invoke the repository editor.  Press the Add button to add a repository item:

2.	After a repository item has been created, you can modify its properties via the Object Inspector:

3.	When all the repository item settings have been defined, it can be assigned to a vertical grid row:

4.	The ExpressVerticalGrid instantly reflects the changes made:

Note: If using Delphi versions prior to Delphi 6 to avoid runtime exceptions include the uses clause with unit source files where the editors you intent to use in your application are implemented. For example:

//Delphi

//...

uses cxCheckComboBox, cxProgressBar;


Assigning Editors to Editor Rows

Editor rows in the ExpressVerticalGrid control represent the data items. Every editor row represents data items of a particular type. The natural way of assigning editors to the ExpressVerticalGrid rows is to bind an appropriate editor to the row for editing a particular type of row’s data item (note that MultiEditor rows differ in this point, since they can display different types of data items).

There are two ways to assign editors used for editing a row’s data item: using the TcxEditRepository component or the Properties.EditProperties. This topic explains how to bind an editor to the row using the Properties.EditProperties property at design- and runtime.

ASSIGNING EDITORS AT DESIGN TIME

This example binds the editor row to the cxImage editor.

1.	Double-click the vertical grid control to invoke the Row collection editor.

2.	Select the editor row to display its properties.  Expand the Properties member.

3.	Choose cxImage from the Properties.EditProperties combo box.  This associates the Properties.EditProperties property with a TcxImageProperties class containing properties specific to image editors.

4.	Expand the Properties.EditProperties entry within the Object Inspector and modify the assigned editor as required.

5.	Run the application.

ASSIGNING EDITORS AT RUNTIME

This section shows how to assign an editor to a row using code.  The first step is to initialize the Properties.EditPropertiesClass property with the required class name.  The second step is to set up the editor assigned.

The following code assigns an image editor to the Picture row bound to a data field, containing the car photo:

//Delphi

//...

cxDBVerticalGridPicture.Properties.EditPropertiesClass := TcxImageProperties;

with TcxImageProperties(cxDBVerticalGridPicture.Properties.EditProperties) do

begin

  GraphicClassName := 'TJPEGImage';

  Stretch := True;

end;

//...

The result is shown in the following screenshot:

You can specify one editor for displaying data and another editor for editing data within a cell.  This is implemented by handling the Row.OnGetEditingProperties and Row.OnGetEditProperties events.  These events provide an AProperties parameter that allows you to specify the editor properties class containing settings for the in-place editor.  Parameter settings cannot be changed directly.  A repository item of the required type must be created instead and then its Properties member can be assigned to the AProperties parameter.  This technique is illustrated in the RowsMultiEditorsDemo application shipped with the ExpressVerticalGrid.

This demo shows how to assign two different editors to the erCarImage editor row displaying the image.  When data is displayed at runtime, the editor properties are set to TcxImageProperties, and data editing is delegated to TcxBlobEditProperties.

The required repository items settings are shown in the following images:

The following code specifies the editor properties for the erCarImage row via the Row.OnGetEditingProperties and Row.OnGetEditProperties event handlers.

//Delphi

procedure TRowsMultiEditorsDemoMainForm.erCarImagePropertiesGetEditingProperties(

  Sender: TcxCustomEditorRowProperties; ARecordIndex: Integer;

  var AProperties: TcxCustomEditProperties);

begin

  AProperties := erepCarPictEditing.Properties;

end;

procedure TRowsMultiEditorsDemoMainForm.erCarImagePropertiesGetEditProperties(

  Sender: TcxCustomEditorRowProperties; ARecordIndex: Integer;

  var AProperties: TcxCustomEditProperties);

begin

  AProperties := erepCarPictEdit.Properties;

end;

The following screenshots illustrate the result:

The erCarImage row is in display mode

The erCarImage row is in edit mode


Assigning Editors To MultiEditor Rows

MultiEditor rows are capable of displaying data from several data set fields.  Such rows have several data cells within a record and thus you can bind several different editors to a multi editor row.

Multi editor rows publish the Properties.Editors property.  This property provides access to the TcxEditorPropertiesCollection instance (or TcxDBEditorPropertiesCollection instance for data-aware rows), containing the properties of the multi editor row items (data cells).

These properties classes (TcxEditorRowItemProperties and TcxDBEditorRowItemProperties, for data-aware multi editor rows) are inherited from the TcxCustomEditorRowProperties class.  Thus multi editor row items have functionality in common with simple Editor rows and assigning an editor to an item is similar to assigning editors to the editor row.  This topic explains how this can be performed at design- and runtime.

ASSIGNING EDITORS AT DESIGN TIME

This example binds both items of a multi editor row to a cxSpinEdit.  Follow these steps:

1.	Double-click the vertical grid control to invoke the Row collection editor.

2.	Select the multi editor row to display its properties.  Expand the Properties member.

3.	 Click the ellipsis button next to the Properties.Editors property to invoke the Editor properties collection editor.  Create two row items.  For details on creating and setting up multi editor rows, see the Multi Editor Rows topic.

4.	Select the first item and choose cxSpinEdit from the Properties combo box.

5.	Repeat the same action for the second item within the multi editor row.

6.	Run the application.

ASSIGNING EDITORS AT RUNTIME

The sample code below does the same at runtime:

//Delphi

//...

cxDBVerticalGridMPG.Properties.Editors[0].EditPropertiesClass := TcxSpinEditProperties;

cxDBVerticalGridMPG.Properties.Editors[1].EditPropertiesClass := TcxSpinEditProperties;

//...

The following screenshot shows the vertical grid with editors assigned:

You can specify one editor for displaying data and another editor for editing data within a cell.  This is implemented by handling the Row.OnGetEditingProperties and Row.OnGetEditProperties events.  These events provide an AProperties parameter that allows you to specify the editor properties class containing settings for the in-place editor.  Parameter settings cannot be changed directly.  A repository item of the required type must be created instead and then its Properties member can be assigned to the AProperties parameter.  This technique is illustrated in the RowsMultiEditorsDemo application shipped with the ExpressVerticalGrid.

This demo shows how to assign two different editors to the merPaymentDescr multi editor row.  When data is displayed at runtime, the editor properties are set to TcxCurrencyProperties, and data editing is delegated to TcxCalcEditProperties.  The TcxCalcEditProperties are represented via a TcxEditRepositoryCalcItem repository item.  Its settings are demonstrated on the following screenshot:

The following code specifies the editor properties for the PaymentAmount row item via the Row.OnGetEditingProperties event handler.

//Delphi

procedure TRowsMultiEditorsDemoMainForm.merPaymentDescrEditors2GetEditingProperties(

  Sender: TcxCustomEditorRowProperties; ARecordIndex: Integer;

  var AProperties: TcxCustomEditProperties);

begin

  AProperties := erepPaymentAmountEditing.Properties;

end;

The following screenshots illustrate the code’s result:

The PaymentAmount row item is in display mode

The PaymentAmount row item is in edit mode


Obtaining And Setting Cell Values

The ExpressVerticalGrid control displays data within cells.  Each cell is uniquely identified by the row and record to which it belongs.

At runtime, end-users can easily navigate and edit cells.  There are a number of options affecting the editing capabilities of the vertical grid:

•	the Row.Options.Focusing option allows/disallows focusing cells (thus affecting the ability to edit the cell content);

•	the Row.Properties.Options.Editing option enables/disables editing for a particular row;

•	the Grid.OptionsData.Editing option enables/disables editing for all vertical grid rows.

All the above-mentioned options affect end user editing capabilities.  If editing is not available to the end user, cell values still can be accessed and modified by code.  Accessing cell values differs according to the vertical grid data loading mode.

Obtaining And Setting Values in Bound Mode.

When working with a data-aware vertical grid (TcxDBVerticalGrid), cell values can be accessed using TField members.  The following code changes the value of the focused row to the "New Value" string:

//Delphi

var

  AModelField: TField;

//...

with cxDBVerticalGrid1 do

begin

  if Assigned(FocusedRow) then

  begin

    with DataController do

    begin

//switching the grid’s data controller to edit mode

      Edit;

//obtaining the TField instance for the edited row

      AModelField := DataSource.DataSet.FindField(TcxDBVerticalGridItemDataBinding(TcxEditorRow(FocusedRow).Properties.DataBinding).FieldName);

//specifying the new row value

      AModelField.AsString := 'New Value';

//posting changes to the dataset

      Post;

    end;

  end;

end;

//...

Obtaining And Setting Values in Unbound Mode.

When working in unbound mode (cxVerticalGrid), the cell values are available via the Row.Properties.Value property.

The following example replaces the focused cell value with the Text property value from a TEdit:

//Delphi

//...

if Assigned(cxVerticalGrid1.FocusedRow) then

  TcxEditorRow(cxVerticalGrid1.FocusedRow).Properties.Value := Edit1.Text;

//...


Styles Overview

The ExpressVerticalGrid enables you to modify the style of its elements in a number of ways.  Style Modifications are made by altering attributes such as background colors, text font, alignment, etc.  This topic lists all the style settings available and provides an overview of the methods that can be used to apply styles.  Note that style technology is not the limit - the ExpressVerticalGrid also allows you to customize the contents of its elements in any manner you like.  By handling specially designed events, you can paint individual elements manually.  Please refer to the Using Styles Events and Custom Painting Overview topic for details.

The vertical grid provides access to a collection of styles via the VerticalGrid.Styles property.  This property contains the set of styles applied to the different control elements.  The list of all styles available is given below:

Style	Description
Background	Defines the style settings of the vertical grid’s background.
Category	Defines the style settings of category rows.
Content	Defines the style settings of the rows’ contents.
Header	Defines the style settings of row headers.
Inactive	Defines the style settings applied to inactive row headers.
IncSearch	Defines the incremental search item style settings.
Selection	Defines the selected row’s header style settings.

To assign styles to vertical grid control elements, these styles must be created within the TcxStyleRepository.  This component provides storage for individual styles and style sheets – predefined or custom sets of styles (see Using StyleSheets), and provides an embedded style editor.  See the Style Repository topic for comprehensive information on using the TcxStyleRepository component.

The style settings include:

•	Bitmap – specifies the bitmap for painting a vertical grid element;

•	Color – specifies the background color for a vertical grid element;

•	Font – contains font settings for drawing text within an element;

•	TextColor – specifies the text color for painting an element.

These settings can be easily modified via the Object Inspector:

And by code:

//Delphi

//...

var

  AMyStyle: TcxStyle;

//...

AMyStyle := TcxStyle.Create(Self);

AMyStyle.Color := clSkyBlue;

AMyStyle.TextColor := clWhite;

AMyStyle.Font.Style := [fsBold];

cxVerticalGrid.Styles.Category := AMyStyle;

//...

The code execution’s result is shown in the following screenshot:

The VerticalGrid.Styles settings affect the appearance of all similar elements of the vertical grid control.  See the Assigning Styles To Individual Rows, Using Styles Events and Custom Painting Overview topics for details.


Using StyleSheets

The most convenient way of customizing the vertical grid’s appearance is to use style sheets.  Style sheets comprise sets of styles for all the vertical grid’s elements.  A style sheet for the vertical grid control is represented by a TcxVerticalGridStyleSheet class instance.

Instead of creating separate styles for every view element, you can create a style sheet containing all the styles supported by the required grid view and then assign the style sheet to the view’s Styles.StyleSheet property.

The style repository editor allows you to add/delete style sheets, customize their styles, store/restore style sheets to INI files and load predefined style sheets:

The Style Sheet Class combo-box allows you to select the type of the style sheet you want to create.  When you select any item within the left pane, a sample vertical grid in the preview section is automatically repainted to reflect the new color scheme.

For instance, a vertical grid control with the DevExpress style applied will look as follows:

Note: when you create a style sheet, all its styles are added to the TcxStyleRepository.Items collection.  But when you delete a style sheet, the corresponding styles are NOT deleted automatically.  If necessary though, you can delete them manually.

The StyleSheet Editor

Like the Predefined StyleSheets dialog, the StyleSheet Editor allows WYSIWYG style sheet creation.  Select the desired style sheet from the list and click the [Edit…] button to activate the editor.

The styles listbox displays the list of styles available for the current grid view.  Each style corresponds to a grid view element.

The preview section immediately reflects any changes after the Color and Font dialogs are closed.  The following image shows a grid control with the style changed for the Content element.  The background and text colors are blue and white respectively.


Assigning Styles To Individual Rows

The styles technology introduced by the ExpressVerticalGrid enables you to assign common styles to elements of a particular type. However, there may be situations when you want to provide different styles to elements of the same type. This topic describes how to assign styles to individual rows. For more information on assigning styles to individual elements of the same type, please refer to the Using Styles Events and Custom Painting Overview topics.

Vertical grid rows publish the Row.Styles property.  This property allows styles to be assigned to the row header and row contents.

The following example assigns styles to the category and editor rows.  The initial appearance of the vertical grid control is shown in the image below:

Follow the steps below.

1.	Drop a TcxStyleRepository component on a form.  Double-click it to invoke the Styles editor.  Create a style, name it CategoryStyle and modify its settings.

2.	Create another style, name it EditorRowStyle and set it up as required.

3.	Double-click the vertical grid control to invoke the Rows editor.  Select the category row and assign CategoryStyle to the Row.Styles.Header property of the category row.

4.	Select the editor row and assign EditorRowStyle to the Row.Styles.Content property of the editor row.

5.	Run the application to see the result.

Note: assigning styles to individual rows overrides the VerticalGrid.Styles property settings.  Other ways to override the VerticalGrid.Styles settings are by using the styles events and the custom painting mechanism.


Assigning Conditional Styles

In addition to static styles (see the Styles Overview topic for details), the ExpressVerticalGrid provides a way to assign conditional styles to the row headers and data cells.  This is implemented via handling several events:

Style	Description
OnGetCategoryStyle	Occurs before assigning a style for the category rows.
OnGetContentStyle	Occurs before assigning a style for the editor row contents.
OnGetHeaderStyle	Occurs before assigning a style for the editor row headers.

The following example shows the handling of these events.  It creates three styles: ACategoryStyle, AHeaderStyle, AContentStyle, for the category and editor row headers and editor row data cells respectively.

The initial appearance of the vertical grid control is shown below:

//Delphi

procedure TForm1.FormCreate(Sender: TObject);

begin

  ACategoryStyle := TcxStyle.Create(Self);

  AContentStyle := TcxStyle.Create(Self);

  AHeaderStyle := TcxStyle.Create(Self);

  ACategoryStyle.Color := $00D2814F;

  ACategoryStyle.TextColor := clYellow;

  ACategoryStyle.Font.Style := [fsBold];

  AContentStyle.Color := $00E1FFFF;

  AContentStyle.TextColor := clRed;

  AHeaderStyle.Color := $00DEA27C;

  AHeaderStyle.TextColor := clWhite;

end;

procedure TForm1.cxDBVerticalGridStylesGetCategoryStyle(

  Sender: TObject; ARow: TcxCustomRow; var AStyle: TcxStyle);

begin

  if TcxCategoryRow(ARow).Properties.Caption = 'Car' then

    AStyle := ACategoryStyle;

end;

procedure TForm1.cxDBVerticalGridStylesGetContentStyle(

  Sender: TObject; AEditProp: TcxCustomEditorRowProperties;

  AFocused: Boolean; ARecordIndex: Integer; var AStyle: TcxStyle);

begin

  if not (ARecordIndex = -1) then

  begin

    if (AEditProp.Caption = 'HP') and (AEditProp.Values[ARecordIndex] > 300) then

      AStyle := AContentStyle;

  end;

end;

procedure TForm1.cxDBVerticalGridStylesGetHeaderStyle(

  Sender: TObject; ARow: TcxCustomRow; var AStyle: TcxStyle);

begin

  if TcxEditorRow(ARow).Properties.Caption = 'HP' then

    AStyle := AHeaderStyle;

end;

The result of the code execution is shown in the following screenshot:


Custom Painting Overview

The ExpressVerticalGrid provides two general ways to customize the appearance of its elements. The first way is to change the styles of its elements. Please refer to the Styles Overview and Using Styles Events topics for information on the style technology capabilities. Generally, styles are everything you need to give the desired look to your vertical grid control. However, there can be situations when you need greater control over the appearance and contents of elements. In this case, you should paint the elements manually. This topic explains the basics of how to do this.

CUSTOM PAINTING BASICS

You can paint vertical grid elements manually by handling specially designed events of the vertical grid control.

Event	Description
OnDrawBackground	Occurs before painting the vertical grid’s background.
OnDrawRowHeader	Occurs before painting row headers.
OnDrawValue	Occurs before painting row values.

Thus, you can provide a custom appearance for all element types in all their states.

Custom painting events have different parameter sets since they are designed to paint different elements. However, some of the parameters are common for all events, as listed below:

Parameter	Description
ACanvas	Represents a TCanvas instance, defining the graphic surface of the painted element.  This object provides various properties and methods for painting the desired grid element.
APainter	Specifies a TcxvgPainter instance.  This object provides various methods for painting vertical grid elements.
Done	A boolean parameter that specifies whether default painting is required.  Setting it to False enables default painting, setting it to True disables it.


Painting Of The Vertical Grid Background
Painting The Vertical Grid’s Background

The ExpressVerticalGrid control provides several events allowing custom painting of the control’s elements (see the Custom Painting Overview topic for more information).  The OnDrawBackground event occurs before painting the vertical grid’s background.  Its parameters are listed below:

Parameter	Description
ACanvas	Specifies the surface of the control’s background being painted.  This parameter provides access to various painting methods.
R	Represents the background’s bounding rectangle.
AViewParams	Represents an object containing view information about the painted area.
Done	Specifies whether the default painting routines should be suppressed. Set the parameter to True, to cancel default painting; set it to False to allow the default painting. In the latter case, the changes you make are discarded.

The following OnDrawBackground event handler fills the vertical grid control’s background with a bitmap:

//Delphi

procedure TStylesSimpleDemoMainForm.cxDBVerticalGridDrawBackground(

  Sender: TObject; ACanvas: TcxCanvas; const R: TRect;

  const AViewParams: TcxViewParams; var Done: Boolean);

var

  AImage: TBitmap;

begin

  AImage := TBitmap.Create;

  AImage.LoadFromFile('c:\images\blue.bmp');

  ACanvas.FillRect(R, AImage);

  Done := True;

  AImage.Free;

end;

The code’s result is shown in the following image:


Painting Of The Row Headers
Painting Row Headers

The ExpressVerticalGrid control provides several events allowing custom painting of the control’s elements (see the Custom Painting Overview topic for more information).  The OnDrawRowHeader event occurs before painting the vertical grid’s row headers.  Its parameters are listed below:

Parameter	Description
ACanvas	Specifies the surface of the row header being painted.  This parameter provides access to various painting methods.
APainter	Represents the painter object used for default painting. You can use the interface provided by the object to paint the header using the current style settings.
AHeaderViewInfo	Specifies the object providing view information about the row header being painted.  To obtain detailed information that depends on the row type, a type cast must be performed.  For instance, if the current row is a category row, this parameter must be converted to the TcxCategoryRowHeaderInfo type.
Done	Specifies whether the default painting routines should be suppressed. Set the parameter to True, to cancel default painting; set it to False to allow default painting. In the latter case, the changes you make are discarded.
The following OnDrawRowHeader event handler paints the parent rows’ expand buttons in white or yellow color depending on the row’s expanded state:

//Delphi

procedure TStylesSimpleDemoMainForm.cxDBVerticalGridDrawRowHeader(

  Sender: TObject; ACanvas: TcxCanvas; APainter: TcxvgPainter;

  AHeaderViewInfo: TcxCustomRowHeaderInfo; var Done: Boolean);

var

  AColor: TColor;

begin

  with AHeaderViewInfo do

  begin

    if Row.Expanded then

      AColor := clWhite

    else

      AColor := clYellow;

    APainter.Painter.DrawExpandButton(ACanvas, ButtonRect, Row.Expanded, AColor);

  end;

end;

The following image shows the code’s result:


Painting Of The Row Values
Painting Row Values

The ExpressVerticalGrid control provides several events allowing custom painting of the control’s elements (see the Custom Painting Overview topic for more information).  The OnDrawValue event occurs before painting the vertical grid’s row values.  Its parameters are listed below:

Parameter	Description
ACanvas	Specifies the surface of the row value being painted.  This parameter provides access to various painting methods.
APainter	Represents the painter object used for default painting. You can use the interface provided by the object to paint the header using the current style settings.
AValueInfo	Specifies the object providing view information about the row cell value being painted.
Done	Specifies whether the default painting routines should be suppressed. Set the parameter to True, to cancel default painting; set it to False, to allow default painting. In the latter case, the changes you make are discarded.

The following code shows the OnDrawValue event handler drawing the HP row values over 300 in red:

//Delphi

procedure TStylesSimpleDemoMainForm.cxDBVerticalGridDrawValue(

  Sender: TObject; ACanvas: TcxCanvas; APainter: TcxvgPainter;

  AValueInfo: TcxRowValueInfo; var Done: Boolean);

begin

  if (TcxEditorRow(AValueInfo.Row).Properties.Caption = 'HP') and (cxDBVerticalGridHP.Properties.Values[AValueInfo.RecordIndex] > 300)   then

  begin

    ACanvas.FillRect(AValueInfo.BoundsRect);

    ACanvas.Font.Color := clRed;

    AValueInfo.Transparent := True;

  end;

end;

The code’s result is shown in the following image:


Customization Form Overview

The ExpressVerticalGrid provides facilities for customizing the rows layout.  This is implemented via the Customization Form.  This form is used to hide/show rows in the grid and to rearrange rows as required.  When a row is hidden from the grid by moving it to the Customization Form, that row’s Visible property value is False and VisibleIndex property value is –1.

In order to start a customization session, the Customization Form must be made visible by setting the VerticalGrid.Customizing.Visible property to True.  After the Customization Form appears on-screen, rows can be dragged to it:

The ExpressVerticalGrid Customization Form contains two pages: Rows and Categories, storing simple and multi editor rows and category rows.  Rows appear within these pages in the same order as they appear within the grid control:

When category rows are moved to the Customization Form, their children are also moved to the Customization Form.  The Categories page contains the New… and Delete buttons for creating and deleting category rows.  The categories created are shown within the Customization Form and they can be dragged to the vertical grid control.  Note: the children of the category rows are moved also.

Another reason for using the Customization Form is to rearrange rows within the vertical grid control.  Layout customization is only enabled while the Customization Form is displayed.

To change the rows order, select the desired row and drag it to a new location within the grid control.  Note how the mouse cursor is changed during drag:

•	the screenshot below shows the situation where the dragged row will be added as the child for the row located under the mouse cursor:

The Trademark row on the image will be positioned as a child of the Engine category row.

•	the following screenshot shows the case when the dragged row will be positioned at the same level as the row located under the mouse pointer:

The Trademark row on the picture will be positioned at the same level as the Car category, i.e. the CarInfo category row’s direct child.


Implementing Drag-And-Drop Operations

The ExpressVerticalGrid provides enhanced facilities for dragging rows. End users can drag rows within the control to change their order and organize them into a tree. Also, rows can be dragged to the Customization Form and back to the control to hide and show them respectively. These drag and drop operations are implemented by the control and do not require coding. See the Customization Form Overview topic for details on enabling and disabling these drag and drop operations and the way that they are performed.

This topic describes implementing drag and drop between vertical grid controls and other controls.

Dragging rows between vertical grid controls.

In this section, dragging rows between vertical grid controls is discussed.  Create two TcxVerticalGrid controls.  Set their DragMode properties to dmAutomatic to enable automatic start of drag-and-drop operations.  Fill one of them with rows as shown in the following screenshot (for more information on creating rows see the Creating a Tree-like Structure Of Rows topic):

Drag-and-drop functionality in this example is implemented by handling the OnDragOver and OnDragDrop events.  The first event handler specifies whether the drag-and-drop operation is allowed and the OnDragDrop event handler implements the main functionality.

procedure TForm1.cxVerticalGrid2DragDrop(Sender, Source: TObject; X,

  Y: Integer);

var

  ADraggedRow, ARow, AParentRow, AChildRow: TcxCustomRow;

  I: Integer;

begin

//obtaining the TcxCustomRow instance corresponding to the dragged //row

  ADraggedRow := TcxVerticalGrid(Source).FocusedRow;

//calculating hit information at the drop point and obtaining the row //at the drop point

  cxVerticalGrid2.HitTest.ReCalculate(Point(X, Y));

  AParentRow := TcxVerticalGrid(Sender).HitTest.HitRow;

//if the drop point is over a row...

  if Assigned(AParentRow) then

  begin

//then adding the dragged row as the target row’s child

    ARow := TcxVerticalGrid(Sender).AddChild(AParentRow, TcxCustomRowClass(ADraggedRow.ClassType));

//copying the dragged row properties to the row created

    ARow.Assign(ADraggedRow);

  end

  else

  begin

//if the drop point is not over a row, then a new row added to the //root level of the vertical grid control

    ARow := TcxVerticalGrid(Sender).Add(TcxCustomRowClass(ADraggedRow.ClassType));

//copying the dragged row’s properties to the row created

    ARow.Assign(ADraggedRow);

  end;

//if the dragged row has child rows

  if (ADraggedRow.HasChildren) then

  begin

    for I := 0 to ADraggedRow.Count - 1 do

    begin

//then the child collection structure is copied to the target //vertical grid control

      AChildRow := TcxVerticalGrid(Sender).AddChild(ARow, TcxCustomRowClass(ADraggedRow.Rows[I].ClassType));

      AChildRow.Assign(ADraggedRow.Rows[I]);

    end;

  end;

end;

procedure TForm1.cxVerticalGrid2DragOver(Sender, Source: TObject; X,

  Y: Integer; State: TDragState; var Accept: Boolean);

begin

//determining whether the drag-and-drop operation is allowed

  Accept := (Sender = cxVerticalGrid2) and (Source = cxVerticalGrid1);

end;

The drag-and-drop operation’s result is shown in the following screenshot:

Dragging from the vertical grid control to a VCL control.

This section discusses dragging rows from the vertical grid control to other VCL controls.  The source vertical grid control is set up as in the previous section.  The destination VCL control is a TListBox.  Set the DragMode property of the vertical grid and the list box to dmAutomatic to enable automatic start of drag-and-drop operations.

The TListBox.OnDragOver event handler determines whether the dragged row can be dropped.  The TListBox.OnDragDrop event handler implements the main functionality of this example.  It determines the type (category, editor or multi editor) of the dragged row and, depending on that information, creates a string composed of the dragged row’s caption and row value.

procedure TForm1.ListBox1DragOver(Sender, Source: TObject; X, Y: Integer;

  State: TDragState; var Accept: Boolean);

begin

//determining whether the drag-and-drop operation is allowed

  Accept := (Sender = ListBox1) and (Source = cxVerticalGrid1);

end;

procedure TForm1.ListBox1DragDrop(Sender, Source: TObject; X, Y: Integer);

var

  ADraggedRow: TcxCustomRow;

  Str: String;

  I: Integer;

begin

//obtaining the dragged row

  ADraggedRow := TcxVerticalGrid(Source).FocusedRow;

//creating a string composed of the row caption and the row value

  if ADraggedRow is TcxCategoryRow then

    Str := TcxCategoryRow(ADraggedRow).Properties.Caption

  else

    if ADraggedRow is TcxEditorRow then

      Str := TcxEditorRow(ADraggedRow).Properties.Caption + ' : ' + TcxEditorRow(ADraggedRow).Properties.Value

    else

      if ADraggedRow is TcxMultiEditorRow then

      begin

        for I := 0 to TcxMultiEditorRow(ADraggedRow).Properties.Editors.Count - 1 do

        begin

          Str := Str + TcxMultiEditorRow(ADraggedRow).Properties.Editors[I].Caption + ' : ' +  TcxMultiEditorRow(ADraggedRow).Properties.Editors[I].Value;

          Str := Str + ' | ';

        end;

      end;

//adding the string created to the TListBox control

  TListBox(Sender).AddItem(Str, nil);

end;

The drag-and-drop operation result is shown in the following screenshot:


Storing And Restoring The ExpressVerticalGrid Layout

The ExpressVerticalGrid control provides a means to save and restore its layout. This functionality is encapsulated in a series of methods:

Method	Description
StoreToIniFile	Stores the vertical grid layout to an INI-file.
RestoreFromIniFile	Restores the vertical grid layout from an INI-file.
StoreToRegistry	Stores the vertical grid layout to a registry key.
RestoreFromRegistry	Restores the vertical grid layout from a registry key.
StoreToStream	Stores the vertical grid layout to a stream.
RestoreFromStream	Restores the vertical grid layout from a stream.

The above mentioned methods save and restore the layout information, which includes:

•	the vertical grid control Name, OptionsView.RowHeaderWidth and OptionsView.ValueWidth property values;

•	the row class name and  Height, Visible, Expanded and Index property values;

•	the row position within the hierarchy (ParentID attribute, specifying the Index property value of the owning row).

Examples of saving the ExpressVerticalGrid layout are demonstrated below:

•	Using the StoreToIniFile method:

//Delphi

cxDBVerticalgrid.StoreToIniFile('c:\storetest.ini');

The storetest.ini file portion is demonstrated below:

[cxDBVerticalGrid: TcxDBVerticalGrid]

=

HeaderWidth=220

ValueWidth=171

[cxDBVerticalGrid/0: TcxCategoryRow]

=

AParentID=-1

Index=0

Visible=True

Height=-1

Expanded=True

[cxDBVerticalGrid/1: TcxDBMultiEditorRow]

=

AParentID=0

Index=0

Visible=True

Height=-1

Expanded=True

[cxDBVerticalGrid/2: TcxDBMultiEditorRow]

=

AParentID=0

Index=1

Visible=True

Height=-1

Expanded=True

[cxDBVerticalGrid/3: TcxCategoryRow]

=

AParentID=-1

Index=1

Visible=True

Height=-1

Expanded=True

•	Using the StoreToRegistry method. Keep in mind, that this method by default stores the layout to the HKEY_CURRENT_USER registry key. The string parameter accepted by this method represents the registry key suffix.

//Delphi

cxDBVerticalgrid.StoreToRegistry('VGrid\StoreTest');

The system registry key which represents the stored layout is demonstrated in the following screenshot:

Note:	the number of rows within the vertical grid control must remain the same between saving and restoring, otherwise restoring will fail.


Converting To The ExpressVerticalGrid

If you upgrade to the new ExpressVerticalGrid controls you may need to exchange data between old and new versions of the controls. The ExpressVerticalGrid package provides tools that allow users to convert data from the legacy controls at design time.

These converters are available for the following ExpressVerticalGrid controls:

•	cxVerticalGrid;

•	cxDBVerticalGrid;

•	cxRTTIInspector.

Converters apply to the dxInspector, dxDBInspector, dxRTTIInspector that serve as sources.

The following table maps the source and target controls:

Source	Target
dxInspector	cxVerticalGrid
dxDBInspector	cxDBVerticalGrid
dxRTTIInspector	cxRTTIInspector

Consider a conversion example for the dxDBInspector and cxDBVerticalGrid controls.

To make a conversion right-click the target control and then select Import… item from the pop-up menu:

The Import dialog window now appears:

When you invoke the converter for the desired control it automatically recognizes the source control type and provides a list of available source controls in the Import dialog for importing into the target control. Select the source control to be imported and then click on the Import button. The import operation is now finished:

Conversion procedures for the other controls mentioned above are similar. However conversion is not valid for the controls descendants for both versions. You should implement custom converters for the new types.

Note the following:

•	If the row’s TdxInspectorRow.IsCategory property is set to True this row will be converted to the TcxCategoryRow type. If the row type is TdxInspectorComplexRow the row will be converted to the TcxMultiEditorRow type. The other row types will be converted to the TcxEditorRow type;

•	The row’s tree structure which was created in the target control mirrors the tree structure in the source control;

•	All the data binding settings in the target control are the same as they were in the source control;

•	No source controls events are handed off to the target controls;

•	Due to different settings for the PaintStyle property in the controls the following conversion rule is applied:

Source	Target
ipsCategorized	psdotNet
ipsNet	psdotNet
ipsExtended	psDelphi
ipsSimple	psDelphi
ipsStandard	psDelphi
•	If the source control TdxInspector.Flat property value is True the target control TcxLookAndFeel.Kind property’s value will be lfFlat. Otherwise the TcxLookAndFeel.Kind property’s value is lfStandard;

•	If the ioAutoBandCount flag on the TdxInspector.Options property is active the TcxVerticalGrid.LayoutStyle property’s value is ulsBandsView. Otherwise the TcxVerticalGrid.LayoutStyle property’s value is ulsSingleRecordView.


Legend

 Protected

 Published

 ReadOnly


cxExportVGLink Unit Overview
cxExportVGLink Unit

Routines

cxExportVGToExcel

cxExportVGToHTML

cxExportVGToText

cxExportVGToXML


cxExportVGToExcel
cxExportVGToExcel Procedure

See Also

Exports data from the grid control to an Excel spreadsheet file.

Unit

cxExportVGLink

Declaration

procedure cxExportVGToExcel(const AFileName: string; AVerticalGrid: TcxCustomVerticalGrid; AExpand: Boolean = True; AUseNativeFormat: Boolean = True; ARecordPerBand: Integer = 8; const AFileExt: string = 'xls');

Description

The AFileName parameter specifies the destination Excel spreadsheet's file name. You don’t have to specify a file extension for the AFileName as an xls value for the file extension is automatically appended using the AFileExt parameter's value.

The AVerticalGrid parameter specifies the source ExpressVerticalGrid control.

The AExpand parameter specifies whether collapsed rows will be expanded before exporting. If the value of the AExpand parameter is True all rows in the control will be expanded and visible in the exported spreadsheet file.

The AUseNativeFormat parameter specifies whether record data will be converted into an appropriate Excel format.

The ARecordPerBand parameter specifies the number of records grouped per band in the destination spreadsheet file.

Note: when the ExpressVerticalGrid is in Grid Mode (the value of the DBVerticalGridDataController.GridMode property is True) records that are currently cached (as specified by the DBVerticalGridDataController.GridModeBufferCount property) will be exported. If the value of the DBVerticalGridDataController.GridMode property is False all records will be exported.

The following code exports data from the grid control into a spreadsheet file:

// Delphi

//...

cxExportVGToExcel('C:\Export\VGridExcel', cxDBVerticalGrid);

The following image shows the exported spreadsheet in MS Excel:


cxExportVGToHTML
cxExportVGToHTML Procedure

See Also

Exports data from the grid control to an HTML file.

Unit

cxExportVGLink

Declaration

procedure cxExportVGToHTML(const AFileName: string; AVerticalGrid: TcxCustomVerticalGrid; AExpand: Boolean = True; ARecordPerBand: Integer = 8; const AFileExt: string = 'html');

Description

The AFileName parameter specifies the destinations HTML file's name. You don’t have to specify a file extension for the AFileName as an html value is automatically appended using the AFileExt parameter's value.

The AVerticalGrid parameter specifies the source ExpressVerticalGrid control.

The AExpand parameter specifies whether collapsed rows will be expanded before exporting. If the value of the AExpand parameter is True, all rows in the control will be expanded and visible in the exported HTML file.

The ARecordPerBand parameter specifies the number of records grouped per band in the target HTML file.

Note: when the ExpressVerticalGrid is in Grid Mode (the value of the DBVerticalGridDataController.GridMode property is True) records that are currently cached (as specified by the DBVerticalGridDataController.GridModeBufferCount property) will be exported. If the value of the DBVerticalGridDataController.GridMode property is False all records will be exported.

The following code exports data from the grid control to an HTML file:

// Delphi

//...

cxExportVGToHTML('C:\Export\VGridHTML', cxDBVerticalGrid);

The following image shows the exported HTML page in Internet Explorer:


cxExportVGToText
cxExportVGToText Procedure

See Also

Exports data from the grid control to an ASCII text file.

Unit

cxExportVGLink

Declaration

procedure cxExportVGToText(const AFileName: string; AVerticalGrid: TcxCustomVerticalGrid; AExpand: Boolean = True; const ASeparator: string = ''; const ABeginString: string = ''; const AEndString: string = ''; ARecordPerBand: Integer = 8; const AFileExt: string = 'txt');

Description

The AFileName parameter specifies the destination text file's name. You don’t have to specify the AFileName file extension as a txt value is automatically appended using the AFileExt parameter's value.

The AVerticalGrid parameter specifies the source ExpressVerticalGrid control.

The AExpand parameter specifies whether collapsed rows will be expanded before exporting. If the value of the AExpand parameter is True all rows in the control will be expanded and visible in the exported text file.

The ASeparator parameter specifies the delimiter used between all cells.

The ABeginString and AEndString parameters specify the delimiters for cell data respectively, before and after a cell's data.

The ARecordPerBand parameter specifies the number of records grouped in per band in the target text file.

Note: when the ExpressVerticalGrid is in Grid Mode (the value of the DBVerticalGridDataController.GridMode property is True) records that are currently cached (as specified by the DBVerticalGridDataController.GridModeBufferCount property) will be exported. If the value of the DBVerticalGridDataController.GridMode property is False all records will be exported.

The following code exports data from the grid control to a text file:

// Delphi

//...

cxExportVGToText('C:\Export\VGridText', cxDBVerticalGrid , True, ' ');

The value of the ASeparator parameter is white space.

The following snapshot shows the exported text file in Notepad:


cxExportVGToXML
cxExportVGToXML Procedure

See Also

Exports data from the grid control to an XML file.

Unit

cxExportVGLink

Declaration

procedure cxExportVGToXML(const AFileName: string; AVerticalGrid: TcxCustomVerticalGrid; AExpand: Boolean = True; ARecordPerBand: Integer = 8; const AFileExt: string = 'xml');

Description

The AFileName parameter specifies the destination XML file's name. You don’t have to specify the AFileName file extension as an xml value is automatically appended using the AFileExt parameter's value.

The AVerticalGrid parameter specifies the source ExpressVerticalGrid control.

The AExpand parameter specifies whether collapsed rows will be expanded before exporting. If the value of the AExpand parameter is True all rows in the control will be expanded and visible in the exported XML file.

The ARecordPerBand parameter specifies the number of records grouped per band in the target XML file.

Note: when the ExpressVerticalGrid is in Grid Mode (the value of the DBVerticalGridDataController.GridMode property is True) records that are currently cached (as specified by the DBVerticalGridDataController.GridModeBufferCount property) will be exported. If the value of the DBVerticalGridDataController.GridMode property is False all records will be exported.

The following code exports data from the grid control to an XML file:

// Delphi

//...

cxExportVGToXML('C:\Export\VGridXML', cxDBVerticalGrid);

After running this code two output files are created: a VGridXML.xml file containing data and a VGridXML_xml.xsl file that tells a browser how to display the xml data.

The following image shows the exported XML file in Internet Explorer: