Skip to main content

Records

  • 3 minutes to read

Data displayed in a View consists of records. Each record stores a set of values corresponding to the dataset fields. The fields or attributes of records are referred to as data items in a grid control.

A data controller (the View’s DataController property) provides data loaded from storage as an array of records. A data controller allows you to read and write a value in a record, append, insert, delete or navigate through records and perform many other operations. To access a particular value, you just need to supply the record’s index and the item’s index.

Views display records in different forms.

A Table View (TcxGridTableView) presents records as a set of rows. Items in each row are displayed horizontally. A Banded Table View (TcxGridBandedTableView) can be used to display record items in bands (a band consists of a set of columns).

In a Card and Layout Views (TcxGridCardView, TcxGridLayoutView), each record is presented as a card.

A record in a Chart View (TcxGridChartView) corresponds to category and series values in this category. Series values are presented as data markers and data labels which are visually grouped within the categories and arranged according to the type of the diagram that displays the data.

The term “record” is not relevant in Chart Views, instead “category” and “series values” are used to describe a specific database record. The information below relates to (Banded) Table and Card Views only.

A View does not store all the records itself. Instead, it obtains them from a data controller when necessary. A View also has the ViewData object of class TcxCustomGridTableViewData providing access to the records currently displayed within the View. Each record in ViewData is an object of the TcxCustomGridRecord class. This class is the base class not only for data rows (rows that display item values) but also for other rows that can be focused. The following figure shows the record classes hierarchy:

  • a card (TcxGridCard) – represents a record in a Card View.

  • a grid group row (TcxGridGroupRow) is a row displaying the value of an item (column) by which data is grouped plus group summaries, if any

  • a grid data row (TcxGridDataRow) displaying data

  • a grid master data row (TcxGridMasterDataRow) is a data (non-group) row in a master View

  • the “new item row” (TcxGridNewItemRow) represents the row for entering new data

The next image shows a Table View with the record types marked.

Records are retrieved from a data controller in the order determined by the record index. Record indexes are not changed as a result of sorting or grouping data. They always refer to the same data. Unlike the record index, index defines the visible position of a record and this does change after grouping, sorting and filtering etc.

Using members of the TcxCustomGridRecord class, you can read the values of record fields, determine the index, record index and level of the record, set focus to a record within a View, expand (only for master and group rows) and select the record.

Instances of the TcxCustomGridRecord class are also passed as parameters to style events. For instance, the TcxCustomGridTableViewStyles.OnGetContentStyle event occurs when redrawing a record in a View addressed by a TcxCustomGridRecord object. Depending on record information, you can use different styles to render this record.

The View’s OptionData property specifies different settings relating to record manipulation. It controls whether records can be inserted, appended, edited and deleted.