Skip to main content
All docs
V17.2

Row Class Structure

  • 3 minutes to read

The vertical grid controls (VGridControl and PropertyGridControl) arrange their data in rows. Available row types and their common features are described in the Rows Overview topic. This topic provides detailed information on the class structure of rows and their relation to other classes within a vertical grid control.

Row Class Structure

All rows used in the vertical grids have a number of common features. Rows are all arranged horizontally, they can all be moved and resized, can serve as parents for other rows, etc. Thus, all rows have the same ancestor - the BaseRow class which implements this common functionality. Note that this class is abstract and thus cannot be used directly.

The vertical grids have methods and properties that either return row objects or accept them as parameters. An example is the VGridControlBase.FocusedRow property that returns the currently focused row. Since a row of any type can be focused at a moment, this property returns an object of the BaseRow type. Other members operating on rows also use the BaseRow class as the return or parameter type. This allows you to handle rows of all types using the same property or method. Note that you may need to perform typecasts of such return values to use the functionality specific to each row type.

So, if you want to create your own row type, you need to derive it from the BaseRow class. However, if you want to take advantage of an existing row’s functionality, you can use any BaseRow descendant as the ancestor for your row class.

The image below shows a class diagram of all the rows available within the vertical grid: CategoryRow, EditorRow and MultiEditorRow. The common ancestor for all these row types and a couple of possible descendant rows are also displayed in the image.

Concepts - Rows - Hierarchy

Row objects themselves store only common row settings. Settings specific to each row type are stored in separate objects that can be accessed via specially designed row properties. These specific settings depend on the data displayed by a particular row. If a row does not display any data (CategoryRow), it needs only settings that affect its header. Rows displaying a single cell in each record (EditorRow), need header settings and settings affecting displayed data - bound field name, format string, etc. If a row displays several cells in each record (MultiEditorRow), it needs several objects containing settings for each “item” (thus, it will have several captions, several bound fields, etc).

All objects containing row settings are descendants of the RowProperties class. Please refer to the Row Properties topic for details on these objects and the settings they provide.

The image below illustrates the relation between row objects and their setting objects.

Concepts - Rows - RowProperties

When designing a new row class, you may wish to use a custom row properties object. In this case, you need to override the CreateRowPropertiesCore method of the base row class to return your own object. Note that the returned object must be a RowProperties class descendant.

See Also