![]() |
Prerequisite Knowledge DataGrid Fundamentals: Object Model Overview DataGrid Fundamentals: DataGridControl Class |
Grouping, Sorting, and Auto-Filtering
![]() |
The name of the property in the data item and the value of the FieldName property must be identical in order for grouping and sorting to work. |
Unbound Columns
An "unbound column" is a column that can be used to display non-data related information such as a label or controls that allow some sort of action to be carried out (e.g., a button to open a window in which the current item can be edited). Unlike data bound columns, unbound columns cannot be grouped, sorted, nor can their values be filtered.
Editing
The content of each cell in a column—assuming that the column or its cells are not read-only—can be edited at runtime by the end user through the use of cell editors. Cell editors are created from DataTemplates (see Templates) and are used to edit the content of cells. Custom cell editors can be provided per column by setting a column's CellEditor property, or per data type through the DataGridControl's DefaultCellEditors property (see Cell Editors). A column's CellEditorDisplayConditions property can be set to override the display conditions determined by the parent grid.
![]() |
A cell editor can be displayed without it being in edit mode. |
When a column's CanBeCurrentWhenReadOnly property is false and its ReadOnly property is true, its cells cannot receive focus: clicking on these cells has no effect, and using the keyboard (arrow keys, Tab key, etc.) causes the focus rectangle to skip the cells. Furthermore, the cell's EditTemplate is not displayed. The value of this property is ignored if ReadOnly is set to false.
For more information on editing a validating data, refer to the Editing Data topic.
Virtualization
In addition to the built-in container recycling, which applies to all views, the TableView class provides column virtualization, meaning that columns and cells that are not visible in the viewport are not created until they are brought into the viewport or accessed. If required, column virtualization can be disabled by setting the IsColumnVirtualizationEnabled property to false (by default, true).
Appearance
By default, when a grid is in a card-view layout, the data displayed in a card's title (see Card Views) is determined by a grid's main (primary) column. The content of the cell whose field name matches the field name of the main column will be displayed in the corresponding card's title. If left unmodified, the main column will be the first column that is added to a grid's Columns collection; however, the main column can be changed by setting a column's IsMainColumn property to true.
The columns that are displayed in a grid can be chosen by the user through the column-chooser context menu (see Figure 1), which can be enabled by setting the AllowColumnChooser defined on the view (see UIViewBase class) to true. A column's ShowInColumnChooser property determines whether a column's title is displayed in the menu, allowing its visibility to be manipulated by an end user (see Example 4 in Views and Themes). By default, the column-chooser context menu displays the titles of the columns in the same order as the they are positioned; however, through the ColumnChooserSortOrder property, the order can be changed to sort the titles alphabetically.
Back to Cell Class | Go to Row Class



