In This Topic
The Columns are an essential part of each grid. NOV Grid for .NET generally features two types of columns, that derive from the base NColumn class:
- Data Columns - data columns are represented by the NDataColumn class. data columns are columns which are bound to a specific data source field. Data columns are typically automatically created when you bind the grid to a data source. For more information see the Data Columns topic.
- Calculated Columns - calculated columns are derived from the NCalculatedColumn class. Calculated columns are columns that have a user assigned value to each row. This means that the value they represent is not extracted directly from the data source to which the grid is bound to, but instead use values provided by the user. For more information see Calculated Columns topic.
All types of columns share the following common aspects that are inherited from the base NColumn class:
- Data type
The columns of a grid are designed to be treated as the fields of a relational data table. That means that all the row values for a specific column need to be of the same type (for example boolean, integer, date time etc.). The type of row values can be obtained by the column GetRowValuesType() method. Since each data source field can be nullable or not, columns are also designed to support null values. To check whether a column can accept null values you can use the column GetRowValuesNullable() method.
- Column Header
The column header is a widget that is accessible from the column Header property. The header of a visually represents the column to the user and also indicates the presence of filtering and sorting rules associated with the column. Clicking on the column header typically toggles the column sorting direction. See Column- Header for more info.
- Column Width
The width of the column can be determined in several ways. Additionally the user can also resize the columns or double-click the column separators to "best fit" the columns. See Column- Width for more information.
- Column Protection
The developer can prevent the user from performing some operations with column by protecting them. The column protection properties are described by the Column- Protection topic.
- Column Format and Conditional Formatting
The column format is accessible from the Format property. It is usually automatically assigned based on the column row values type. The column format is responsible for the creation of properly formatted data cell views, as well as for the optional conditional formatting of the data cell views. See Column Formats and Column Conditional Formatting topics for more information.
- Column Editors
The widget that is created for the column values editing is determined by the column editor assigned to the Editor property. Column editors are discussed in the Column- Editors topic.