Express Quantum Grid 6

17
Content If you need to display custom information within a group footer panel, handle the OnCustomDrawPartBackground event. If this event is not handled, group footer panels display the group summaries specified. Please refer to the Summaries topic for additional information. Layout A group footer panels height depends on the style (font settings, in particular) assigned. If the Views OptionsView.FooterAutoHeight option is enabled group footer panels are automatically enlarged vertically when a summary value's text doesnt fit into the footer cells. Page 784 of 3432

Transcript of Express Quantum Grid 6

Page 1: Express Quantum Grid 6

Content If you need to display custom information within a group

footer panel, handle the OnCustomDrawPartBackground

event. If this event is not handled, group footer panels

display the group summaries specified. Please refer to the

Summaries topic for additional information.

Layout A group footer panel’s height depends on the style (font

settings, in particular) assigned. If the View’s

OptionsView.FooterAutoHeight option is enabled group

footer panels are automatically enlarged vertically when a

summary value's text doesn’t fit into the footer cells.

Page 784 of 3432

Page 2: Express Quantum Grid 6

Group RowSee Also

Group rows appear when grouping is applied to a View. Each group row corresponds to a value in a field by whose values the View

is grouped. Group rows can be expanded/collapsed to show/hide data rows that correspond to a particular grouping value.

Feature Related Members

Appearance The common style for all group rows is set via a View’s

Styles.Group property. You can also provide styles for

individual group rows (e.g. rows corresponding to a

particular grouping level) by handling the View’s

Styles.OnGetGroupStyle event. Note that both the

property and the event affect both the group row and the

corresponding row level indent.

The background bitmap for group rows can be set via the

View’s BackgroundBitmaps.Group property.

Custom Draw The View’s OnCustomDrawGroupCell event. Note that this

event doesn’t affect row level indents.

Content By default, group rows display the corresponding column’s

caption, its value and the specified group summaries. You

can specify any custom text to display within group rows

by handling the corresponding custom draw event or

substitute only the text representing the column’s value

using the OnGetDisplayText event.

Layout The View’s OptionsView.GroupRowStyle and

OptionsView.GroupRowHeight properties.

Page 785 of 3432

Page 3: Express Quantum Grid 6

Group Row Popup MenuSee Also

This menu represents a built-in menu available in the cxGridPopupMenu component.

This menu is invoked when right-clicking a group row. Group rows can be sorted:

l by group values (the default option);

l by group summary values. In this instance, each menu caption represents the display text.

Feature Related Members

Visibility The UseBuiltInPopupMenus property of the

cxGridPopupMenu component.

Content All constants for default built-in menu captions are stored

in the cxGridPopUpMenuConsts unit. Refer to the

corresponding section in the cxGridPopupMenu: Resource

Strings topic for detailed information on constants used in

the Group Row Popup Menu.

Use the summary object’s VisibleForCustomization and

DisplayText properties to control the general appearance of

these menu items and to specify their captions.

Refer to the Managing Grid Menus topic, for detailed

information and sample code on how to add custom menu

items to built-in popup menus.

Page 786 of 3432

Page 4: Express Quantum Grid 6

Indicator

If enabled, the indicator is displayed at the left of a grid View. The indicator is divided into cells which correspond to the band

header panel, column header panel, rows (this area is called the row indicator) and the footer panel. The cells corresponding to the

band header panel and column header panel can contain the Quick Column Customization button and Quick Band Customization

button, respectively. The cells that correspond to rows display the corresponding row’s state. Additionally, indicator cells

corresponding to rows can be used to expand/collapse master and group rows and their edges can be used to resize rows, if

allowed.

Feature Related Members

Visibility The View’s OptionsView.Indicator property.

Appearance The indicator’s look and feel depends on the grid

control’s LookAndFeel property settings. The style and

background bitmap can be changed using the View’s

Styles.Indicator and BackgroundBitmaps.Indicator

properties.

Custom Draw Handle the View’s OnCustomDrawIndicatorCell event.

The event’s AViewInfo parameter can be of the

TcxGridIndicatorHeaderItemViewInfo,

TcxGridIndicatorRowItemViewInfo or

TcxGridIndicatorFooterItemViewInfo type depending on

which indicator cell is about to be painted.

Layout The indicator’s width can be changed using the View’s

OptionsView.IndicatorWidth property.

Page 787 of 3432

Page 5: Express Quantum Grid 6

Quick Column Customization Button

The Quick Column Customization button is displayed at the intersection of the column header panel and the indicator. Clicking

this button invokes the Quick Column Customization dropdown, which displays column names in a checklist. Users are able to

toggle columns’ visibility and reorder columns by dragging items in the dropdown. Multiple items can be selected by clicking them

while holding down the Shift and Ctrl keys.

Feature Related Members

Availability The View’s OptionsCustomize.ColumnsQuickCustomization property.

Note that setting this property to True results in enabling the indicator.

Appearance The Quick Column Customization button is an indicator cell. Please refer

to the Indicator topic for information on customizing indicator cells’

appearance.

Behavior The Quick Column Customization dropdown allows users to:

l change the visible state of columns without using the

Customization Form at runtime or the Object Inspector at

design time;

l reorder columns in a View by dragging their names in the

dropdown. This functionality is enabled in a View when the

View’s

OptionsCustomize.ColumnsQuickCustomizationReordering

property is set to True.

Dropdown List’s

Content

The dropdown list displays all columns whose VisibleForCustomization

property value is False.

Dropdown List’s

Layout

You can constrain the dropdown’s height using the View’s

OptionsCustomize.ColumnsQuickCustomizationMaxDropDownCount

property.

Page 788 of 3432

Page 6: Express Quantum Grid 6

Items in Chart ViewsSee Also

For the ExpressQuantumGrid the term "item" is used to describe a column in a data store. In a Chart View, items stand for the

columns that correspond to series, data groups, and the default categories. When series values are grouped at a data level

associated with the visible data group, the unique values of this data group determine the categories which series values are

arranged into. Otherwise, the values of the default categories are used to categorize series values.

Each record in a data store corresponds to a category value and at least one series value.

The arrangement options of the items differ from diagram to diagram since each one provides options for visually representing

category values and series values which are specific to the type of diagram. The only thing you need to address to change the

manner in which the items are displayed within a Chart View is to activate another diagram (by setting its Active property to True).

As with items in tabular and Card Views, series, data groups, and the default categories can be divided into two groups: data-

aware and non data-aware. Data-aware items (TcxGridDBChartSeries, TcxGridDBChartDataGroup, and

TcxGridDBChartCategories) are used in the corresponding data-aware View (TcxGridDBChartView). Non data-aware items

(TcxGridChartSeries, TcxGridChartDataGroup, and TcxGridChartCategories) are elements of the non data-aware View

(TcxGridChartView).

A Chart View has the Series, DataGroups, and Categories properties which maintain the collections of items (series, data groups,

and the default categories, respectively) created within the View. To access the series and data groups which are currently visible

within a Chart View, use the View’s VisibleSeries and VisibleDataGroups properties.

The Component Editor allows you to access all the series and data groups in a Chart View and create/delete them at design time.

You can use the CreateSeries and CreateDataGroup methods to manually create series and data groups at runtime.

It's possible to get and set the value of an item using either the Values collection of the default categories or the Values collection

of a series and data group. Alternatively, you can use the View’s ViewData.Categories, ViewData.Values, and

ViewData.GroupValues indexed collections, which address the same values. To access values of the items which are currently

displayed, use the View’s ViewData.VisibleCategories, ViewData.VisibleValues, and ViewData.VisibleGroupValues, respectively.

To add a series value, call the AddValue method of the corresponding series.

Every item has a DataBinding property which links items to the data in a View’s data controller which retrieves data from and

posts it back to a data store. Data-aware items redefine DataBinding to work with TDataSet fields.

To sort data by an item, you should use its SortOrder property.

Note: The sorting applied to the series takes priority over the sorting by the default categories or a data group. Only a single type

of sorting (either by the default categories/data group or series values) is active at a time within the chart. The series whose values

are sorted can be accessed via the View’s SortedSeries property. End-users are able to customize the sorting applied to the

series using the Customization Form.

Page 789 of 3432

Page 7: Express Quantum Grid 6

Items in Table and Card ViewsSee Also

For the ExpressQuantumGrid the term "item" is used to describe a column in a data store. In a Table View, items stand for

columns and are displayed across the View.

In a Card View, items are Card View rows and are arranged vertically.

The TcxCustomGridTableItem class is the base class for all table items in Card Views.

All items can be divided into two main groups: data-aware and non data-aware.

Data-aware items (TcxGridDBColumn, TcxGridDBBandedColumn, TcxGridDBCardViewRow) are used in corresponding data-aware

Views (TcxGridDBTableView, TcxGridDBBandedTableView, TcxGridDBCardView). Non data-aware items are elements of non

data-aware Views (TcxGridTableView, TcxGridBandedTableView, TcxGridCardView).

Every View has an Items property that maintains the collection of items created within each View. You can use the CreateItem

method (CreateColumn or CreateRow in some Views) to create items manually. In a non data-aware View, you can create

items using the Layout and Data Editor at design time. In a data-aware View, you can call the DataController.CreateAllItems

method to create columns based on dataset fields. The Component Editor allows you to access all items in a View and

Page 790 of 3432

Page 8: Express Quantum Grid 6

create/delete them at design time.

It is possible to get and set a value for an item cell in a focused record via the EditValue member. The data controller gives you the

ability to access the item values of all loaded records.

An item has various attributes controlling its behavior. For instance, you can prevent a user from editing, focusing item cells,

changing the item's position within the "group by" or column header panel, applying sorting or filtering by an item, etc.

Every item has a DataBinding property providing data for items from a View’s data controller. DataBinding retrieves data from

and posts it back to a data store. Data-aware items redefine DataBinding to work with TDataSet fields.

The ExpressQuantumGrid provides a wide range of in-place editors to edit or display item cells. For instance, the TcxCheckBox

editor provides a convenient way to edit Boolean fields. By default, items are assigned default editors as appropriate. In bound

mode, the default editor is specified by the field type. For instance, TcxDateEdit is used to edit TDateField fields. See the

FieldName topic for details.

In unbound mode, the default editor is determined by an item’s DataBinding.ValueTypeClass property. You must specify an

appropriate value type to provide the appropriate behavior when sorting, editing, validating and accessing item values. Refer to the

TcxValueType class to learn more about the default editors assigned in unbound mode.

To assign an editor to an item, you can use either the repository (repository and repository items) or the PropertiesClass object. A

repository item defines the specific editor settings used for a particular item editor. A single repository item can be assigned to the

RepositoryItem property of several items, thus creating items with the same edit behavior. PropertiesClass is another way to set

an item editor. It defines the class of editor properties used to create a specific editor. If both RepositoryItem and PropertiesClass

are assigned, the item editor is determined by a corresponding repository item. The ExpressQuantumGrid gives you the ability to

specify different editors for individual item cells (i.e. on a row by row basis). You can handle the OnGetProperties event and

specify the editor based on the record's position or the data associated with it. For more information refer to the Data Editing

Using Inplace Editors topic.

The GroupIndex property of an item allows you to group data within a View by this item. Grouping operations are implemented

only in Table Views and are not supported in Card Views. You can group data by multiple items. The grid control provides the

"group by" panel to which a user can easily drag a column by its caption to group by this column.

To sort data by an item, you should use the SortOrder property. You can sort by multiple items by setting the SortOrder property

of these items to a value other than soNone. Data in a View is sorted in the exact SortOrder sequence. At runtime, a user can

sort data by clicking a column's caption. A small arrow specifies the current sort order. The up-arrow indicates that data is sorted

in ascending order, while the down-arrow indicates that sorting is performed in descending order.

Data filtering within a View is implemented via a data controller. It provides a Filter property which specifies the filter conditions set

for all the items in a specific View. A filter condition addresses the item, the operator type and the value with which every item cell

is compared. When filtering is applied, only the records matching the filter criteria are displayed within the View.

At runtime, a user can press the filter down-arrow button in a Table View to filter by that column.

Page 791 of 3432

Page 9: Express Quantum Grid 6

When a user selects a value from this list, a new EQUAL filter condition (of type "Column = Value") is added to the existing filter

criteria.

Selecting All from the list clears the filter condition set for the column. The Custom item displays a filter dialog that allows an end-

user to define filter conditions with other operators (=, <>, <, <=, >, >=, LIKE and NOT LIKE). For more information on filter

dialogs, refer to the Runtime Filtering section.

Our grid control gives you the ability to temporarily remove column(s) from a View. At runtime, a user can drag individual columns

onto the Customization form thus hiding them in the View.

To display a column within the View again, the user must drag this column from the customization form onto the column header

or "group by" panel.

Dragging a column onto the Customization form results in setting its Visible property to False. It is possible to prevent a column

from appearing in this form by setting its VisibleForCustomization property to True. In this case, if your column is dragged to the

Customization form, it disappears completely and can only be made visible programmatically.

Page 792 of 3432

Page 10: Express Quantum Grid 6

TcxCustomExtLookupComboBox ObjectHierarchy Properties Methods Events See Also

Represents the base class for lookup editors displaying a grid View in the dropdown window.

Unit

cxDBExtLookupComboBox

TcxCustomExtLookupComboBox = class(TcxCustomDBLookupEdit);

Description

The TcxCustomExtLookupComboBox editor is the ancestor for lookup editors (TcxExtLookupComboBox and

TcxDBExtLookupComboBox) which display grid Views within their dropdown windows. To specify the View for the editor, see its

Properties.View attribute. Only data-aware table and Banded Table Views can be used for this purpose.

A View repository component represented by the TcxGridViewRepository class helps you to create and customize Views. Note:

you must not reuse the same View in your grid control and ExtLookupEditor.

Lookup editors are designed to edit values "indirectly" by picking up a record from the dropdown View. When you select a specific

record from the View, this action changes the display text (the Text property) and the edit value (the EditValue property) obtained

from the selected record.

The edit value is determined by the record’s Properties.KeyFieldNames field. Moreover, the edit value matches this field value.

That is when you modify the EditValue property, the record with the key field matching the edit value is focused and the display

text of ExtLookupEditor is changed.

You can specify more than one field in the KeyFieldNames property, in this case the edit value contains an array of variant values.

The display text is obtained from the Properties.ListFieldItem column of the selected record. You cannot modify the text in the edit

box. It only helps you to identify the selected record visually.

Data-aware lookup editors are used to edit values from one dataset by selecting a record from another dataset (displayed by the

View). The field being edited by a TcxDBExtLookupComboBox control is specified by the editor’s DataBinding.DataField property.

The edit value matches the value of the field being edited.

To make a lookup editor work properly, you need to:

1. Assign a View to the Properties.View property

2. Select a View column (the Properties.ListFieldItem property) whose data will be displayed within the edit box of

ExtLookupEditor

3. For the data-aware ExtLookupEditor, specify the field being edited via the DataBinding.DataField property. This field must

match the Properties.KeyFieldNames property.

4. Specify the key field name(s) via the Properties.KeyFieldNames property to identify records within the dropdown View.

Page 793 of 3432

Page 11: Express Quantum Grid 6

TcxDBExtLookupComboBox ObjectHierarchy Properties Methods Events See Also

Represents a control to edit a dataset field by picking up a record in its dropdown data-aware View.

Unit

cxDBExtLookupComboBox

TcxDBExtLookupComboBox = class(TcxCustomExtLookupComboBox);

Description

The TcxDBExtLookupComboBox control allows you to edit a dataset field referenced by the DataBinding.DataField property

indirectly. You are not able to type the text to change the edit value. Instead, you change the edit value by picking up a record

from the dropdown View. The View’s selected record provides values for the display text (drawn in the edit box) and the edit value

of TcxDBExtLookupComboBox.

The edit value is determined by the record’s Properties.KeyFieldNames field. Moreover, the edit value matches this field value.

That is when you modify the EditValue property, the record with the key field matching the edit value is selected and the display

text of ExtLookupEditor is changed.

The field (the DataBinding.DataField property) being edited by a TcxDBExtLookupComboBox control matches the edit value, i.e.

it matches the value of the selected record’s Properties.KeyFieldNames field.

The editor’s display text is obtained from the Properties.ListFieldItem column of the selected record. You cannot modify the text in

the edit box. It only helps you to identify the selected record visually.

To assign the View to an ExtLookupEditor, see its Properties.View attribute. It is possible to use only a data-aware (Banded)

Table View for this purpose. A View repository component represented by the TcxGridViewRepository class helps you to create

and customize Views.

Note: you must not employ the same View in your grid control and ExtLookupEditor.

To know more about adjusting ExtLooupEditors, refer to the TcxCustomExtLookupComboBox class description.

Page 794 of 3432

Page 12: Express Quantum Grid 6

TcxEditRepositoryExtLookupComboBoxItem ObjectHierarchy Properties Methods See Also

Represents a repository item containing settings for a TcxExtLookupComboBox editor.

Unit

cxDBExtLookupComboBox

TcxEditRepositoryExtLookupComboBoxItem = class(TcxEditRepositoryItem);

Description

TcxEditRepositoryExtLookupComboBoxItem stores properties specific to a TcxExtLookupComboBox editor via the Properties

object. A repository object of the TcxEditRepository class maintains a collection of repository items.

Page 795 of 3432

Page 13: Express Quantum Grid 6

TcxExtLookupComboBox ObjectHierarchy Properties Methods Events See Also

Represents a lookup editor displaying a grid View in its dropdown window.

Unit

cxDBExtLookupComboBox

TcxExtLookupComboBox = class(TcxCustomExtLookupComboBox);

Description

A TcxExtLookupComboBox control displays a data-aware grid View in its dropdown window which is specified by the

Properties.View attribute. Similar to other Express Editors, you have to use the attributes of the Properties object to customize an

ExtLookupEditor.

A TcxExtLookupComboBox control allows you to edit values indirectly. You are not able to type the text to change the edit

value. Instead, you change the edit value by picking up a record from the dropdown View. The View’s selected record provides

values for the display text (drawn in the edit box) and the edit value of TcxDBExtLookupComboBox.

You cannot modify the text (display value) in the edit box. It is used for display purpose only to identify the record being currently

selected.

The edit value of an ExtLookupEditor matches a value of the Properties.KeyFieldNames field of the currently selected record.

When you select a specific record within the dropdown View, the control’s edit value is automatically changed. It always holds a

value of the record’s Properties.KeyFieldNames field. To access the edit value, see the published EditValue property. It is possible

to specify several key field names by separating them with the semicolon. In this case, EditValue will contain an array of variants.

Changing EditValue automatically selects another record in the dropdown View whose key field values are equal to a new edit

value(s).

To assign the View to an ExtLookupEditor, see its Properties.View attribute. It is possible to use only a data-aware (Banded)

Table View for this purpose. A View repository component represented by the TcxGridViewRepository class helps you to create

and customize Views. Note: you must not reuse the same View in your grid control and the ExtLookupEditor.

To get more information on customizing ExtLookupEditors, refer to the TcxCustomExtLookupComboBox topic.

Page 796 of 3432

Page 14: Express Quantum Grid 6

TcxExtLookupComboBoxProperties ObjectHierarchy Properties Methods Events See Also

Contains settings for ExtLookupEditors.

Unit

cxDBExtLookupComboBox

TcxExtLookupComboBoxProperties = class(TcxCustomDBLookupEditProperties);

Description

The TcxExtLookupComboBoxProperties class contains a set of attributes controlling the behavior of ExtLookupEditors

(TcxExtLookupComboBox and TcxDBExtLookupComboBox).

An ExtLookupEditor displays a data-aware (Banded) Table View within its dropdown window specified by the View property.

Selecting a specific record in this View changes the display text and edit value(s) of the editor. The display text is obtained from

the ListFieldItem column of the selected record. The edit value(s) is determined by a selected record’s field(s) set via the

KeyFieldNames property.

You can use the FocusPopup property to enable/disable editing data within the dropdown View. If FocusPopup is set to True, a

user has the full-function grid View in the dropdown (editing, filtering is enabled). Otherwise, a user is not able to edit and filter

data; only sorting and grouping are supported.

Page 797 of 3432

Page 15: Express Quantum Grid 6

TcxCustomExtLookupComboBox.ActivePropertiesTcxCustomExtLookupComboBox See Also

Obtains the properties that are currently applied to a lookup editor.

property ActiveProperties: TcxExtLookupComboBoxProperties;

Description

Use the ActiveProperties property to obtain the properties of the current lookup editor that are currently in effect. This property is

especially useful when the lookup editor has a repository item assigned to it via the RepositoryItem property. In this case the

ActiveProperties property returns the properties of the corresponding repository item that are active while the item is assigned to

the lookup editor. Otherwise, the inherent lookup editor’s properties are returned.

ReadOnly Property

Page 798 of 3432

Page 16: Express Quantum Grid 6

TcxCustomExtLookupComboBox.EditValueTcxCustomExtLookupComboBox See Also

Specifies the value or an array of values edited by ExtLookupEditor.

property EditValue: Variant;

Description

ExtLookupComboBox allows you to edit a value(s) indirectly by picking up a record from the dropdown View.

The EditValue property represents a value(s) being edited. It always matches a value(s) of a specific field(s) set via the

Properties.KeyFieldNames property obtained from the View’s selected record. If the KeyFieldNames property specifies more than

one field names, EditValue represents an array of variant values.

Setting focus to a specific record within the View changes the EditValue property and the text displayed in the edit box. For

TcxDBExtLookupComboBox editors, changing EditValue modifies the value of the dataset field to which the editor is connected

via the DataBinding.DataField attribute.

The value displayed within the ExtLookupEditor is addressed by the Properties.ListFieldItem View column.

Page 799 of 3432

Page 17: Express Quantum Grid 6

TcxCustomExtLookupComboBox.PropertiesTcxCustomExtLookupComboBox

Contains settings affecting the behavior of a ExtLookupEditor.

property Properties: TcxExtLookupComboBoxProperties;

Description

Use attributes of the Properties object to adjust settings of ExtLookupEditor. The main attributes are:

n the View property

Represents the View displayed within the dropdown window of ExtLookupEditor

n the KeyFieldNames property

Specifies one or more fields matching the edit value(s). See the EditValue property to get the edit value(s). If the

KeyFieldNames property specifies several field names delimited by the semicolon, the EditValue property holds an array

of variants (values from the currently selected record in the dropdown View).

For data-aware ExtLookupEditors (TcxDBExtLookupComboBox), the KeyFieldNames property must correspond to the

field being edited by ExtLookupComboBox. This field is set via the DataBinding.DataField property

n the ListFieldItem property

This property is used to specify the column in the dropdown View whose value is displayed in the edit box. It is obtained

from the current record.

Page 800 of 3432