ColumnProps
Defines the properties for configuring a column in the grid, including layout, behavior, and data binding options. Specifies comprehensive column settings that control appearance, functionality, and user interaction capabilities. Enables customization of sorting, filtering, editing, and display characteristics for individual grid columns.
Props
The following table outlines the props for the ColumnProps:
| Name | Type | Default | Description |
|---|---|---|---|
| allowEdit | boolean | true | If false, disables editing for the column's cells in edit mode. Defaults to true, allowing editing. |
| allowFilter | boolean | true | If false, disables filtering for the column, hiding filter bar or menu. Defaults to true, enabling filtering. |
| allowSearch | boolean | true | If true, enables searching for the column in the grid's search bar. |
| allowSort | boolean | true | If false, disables sorting for the column, preventing header click sorting. Defaults to true, enabling sorting. |
| cellClass | string | ((props?: CellClassProps<T>) => string) | - | Applies a CSS class to individual grid cells either globally or conditionally.
Accepts a static class name or a callback function that returns a class name based on cell context.
The callback receives a
|
| clipMode | ClipMode | string | ClipMode.Ellipsis | 'Ellipsis' | Defines the cell content's overflow mode. The available modes are
|
| defaultValue | ValueType | null | null | Default value for the column when adding new records. Ensures consistent initial values for new entries. |
| disableHtmlEncode | boolean | true | If false, encodes HTML in header and content cells, preventing raw HTML rendering. When true, allows raw HTML but requires caution for security. |
| displayAsCheckBox | boolean | false | If true, displays boolean values as checkboxes instead of text. |
| edit | {} | Custom edit cell configuration for advanced editing, such as custom input types or validation logic. Enhances editing flexibility. | |
| editTemplate | null | Template for the column's edit UI, as a string, function, or HTML element ID. Customizes the editor during editing. | |
| field | string | '' | Defines the field name that maps the column to a specific data source property for data binding operations. Enables sorting and filtering functionality based on the specified field name within the dataset. Strongly recommended to avoid JavaScript reserved words and special characters in the field name for optimal compatibility. |
| filter | {} | Defines the filter options to customize filtering for the particular column. | |
| filterTemplate | null | Template for the column's filter UI, as a string, function, or HTML element ID. Customizes the filter interface. | |
| format | string | NumberFormatOptions | DateFormatOptions | null | Defines the format for cell values (e.g., |
| getCommandItems | (event: CommandItemEvent) => React.ReactElement<CommandItemProps>[] | undefined | Callback function that returns command item buttons for each row in the grid. Receives the current row's data and column configuration to determine which commands to display. |
| headerCheckbox | boolean | true | Specifies whether the header checkbox is displayed in the checkbox column.
By default, it is enabled when the column type is set to |
| headerTemplate | null | Renders custom content in the header cell using a template string, function, or HTML element ID. Supports advanced header customization like icons or buttons. | |
| headerText | string | - | Sets the text displayed in the column header. Defaults to the |
| headerTextAlign | TextAlign | string | - | Aligns text specifically in the header cell (e.g., |
| headerValueAccessor | (props?: HeaderValueAccessorProps) => ValueType | T | - | Fires when a header cell begins to render or refresh in the grid. Allows transformation of header text for display purposes only. Does not affect the underlying data source. |
| isPrimaryKey | boolean | false | If true, marks the column as a primary key for unique record identification. Critical for editing, adding and deleting operations. |
| sortComparer | (referenceValue: ValueType, comparerValue: ValueType, referenceRowData?: T, comparerRowData?: T, sortDirection?: string) => number | string | - | Fires when a sorting operation begins on a each grid column. Allows overriding the default sorting behavior with custom logic by comparing reference and comparer values. Advanced custom sorting can be implemented using complete row data and the current sort direction context.
|
| template | null | Renders custom content in data cells using a template string, function, or HTML element ID. Enables complex or dynamic cell layouts. | |
| templateSettings | {} | Configures the | |
| textAlign | TextAlign | string | TextAlign.Left | 'Left' | Aligns text in header and content cells (e.g., |
| type | ColumnType | string | null | Defines the column’s data type (e.g., |
| validationRules | null | Validation rules for editing (e.g., | |
| valueAccessor | (props?: ValueAccessorProps<T>) => ValueType | T | - | Fires when a data cell begins to render or refresh in the grid. Allows transformation of cell values for display purposes only. Does not affect the underlying data source. |
| visible | boolean | true | If false, hides the column. Defaults to true for visibility. Useful for conditional display based on user roles or state. |
| width | string | number | '' | Defines the column width in pixels (e.g., 100) or percentage (e.g., '20%'). Controls the column's size in the grid layout. |