Skip to content

GridSingleSelectColDef API

Extended documentation for the GridSingleSelectColDef interface with detailed information on the module's properties and available APIs.

Demos

Import

import { GridSingleSelectColDef } from '@mui/x-data-grid-premium'
// or
import { GridSingleSelectColDef } from '@mui/x-data-grid-pro'
// or
import { GridSingleSelectColDef } from '@mui/x-data-grid'


Column Definition interface used for columns with the singleSelect type.

Properties

The unique identifier of the column. Used to map with GridRowModel values.

Type:string


The type of the column.

Type:'singleSelect'

Default:'singleSelect'


Optional

If true, the cells of the column can be aggregated based.

Type:boolean

Default:true


Optional

Align cell content.

Type:GridAlignment


Optional

Limit the aggregation function usable on this column.
By default, the column will have all the aggregation functions that are compatible with its type.

Type:string[]


Optional

Class name added to cells in this column.

Type:GridCellClassNamePropType<R, V>


Optional

Number of columns a cell should span.

Type:number | GridColSpanFn<R, V, F>

Default:1


Optional

The tooltip text shown when the column header name is truncated.

Type:string


Optional

If true, the column menu is disabled for this column.

Type:boolean

Default:false


Optional

If true, this column will not be included in exports.

Type:boolean

Default:false


Optional

If true, this column cannot be reordered.

Type:boolean

Default:false


Optional

Display mode for the cell:
- 'text': For text-based cells (default)
- 'flex': For cells with HTMLElement children

Type:'text' | 'flex'


Optional

If true, the cells of the column are editable.

Type:boolean

Default:false


Optional

If true, the column is filterable.

Type:boolean

Default:true


Optional

Allows setting the filter operators for this column.

Type:readonly GridFilterOperator<R, V, F>[]


Optional

The flex grow factor of the column. Must be a positive number.

Type:number


Optional

The callback that generates a filtering function for a given quick filter value.
This function can return null to skip filtering for this value and column.

Type:GetApplyQuickFilterFn<R, V>


Optional

Used to determine the label displayed for a given value option.

Type:(value: ValueOptions) => string


Optional

Used to determine the value used for a value option.

Type:(value: ValueOptions) => any


Optional

Provide an alternative comparator function for sorting.
Takes precedence over sortComparator.

Type:(sortDirection: GridSortDirection) => GridComparatorFn<V> | undefined


Optional

If true, the rows can be grouped based on this column values (pro-plan only).
Only available in DataGridPremium.

Type:boolean

Default:true


Optional

Function that transforms a complex cell value into a key that be used for grouping the rows.

Type:GridGroupingValueGetter<R>


Optional

Align column header content.

Type:GridAlignment


Optional

Class name added to the column header cell.

Type:GridColumnHeaderClassNamePropType


Optional

The title displayed in the column header cell.

Type:string


Optional

If false, removes the option to hide this column.

Type:boolean

Default:true


Optional

Toggle the visibility of the sort icons.

Type:boolean

Default:false


Optional

The maximum width of the column in pixels.

Type:number

Default:Infinity


Optional

The minimum width of the column in pixels.

Type:number

Default:50


Optional

Function that takes the clipboard-pasted value and converts it to a value used internally.

Type:GridPastedValueParser<R, V, F>


Optional

If false, the menu items for column pinning menu will not be rendered.
Only available in DataGridPro.

Type:boolean

Default:true


Optional

Callback fired when the edit props of the cell changes.
Processes the props before being saved into the state.

Type:(params: GridPreProcessEditCellProps) => GridEditCellProps | Promise<GridEditCellProps>


Optional

Override the component rendered as cell for this column.

Type:(params: GridRenderCellParams<R, V, F>) => React.ReactNode


Optional

Override the component rendered in edit cell mode for this column.

Type:(params: GridRenderEditCellParams<R, V, F>) => React.ReactNode


Optional

Override the component rendered in the column header cell.

Type:(params: GridColumnHeaderParams<R, V, F>) => React.ReactNode


Optional

Allows to render a component in the column header filter cell.

Type:(params: GridRenderHeaderFilterProps) => React.ReactNode


Optional

If false, disables resizing for this column.

Type:boolean

Default:true


Optional

Function that returns a specific value to be used in row spanning.

Type:GridValueGetter<R, V, F>


Optional

If false, disables sorting for this column.

Type:boolean

Default:true


Optional

A comparator function used to sort rows.

Type:GridComparatorFn<V>


Optional

The order of the sorting sequence.

Type:readonly GridSortDirection[]


Optional

Example values that can be used by the grid to get more context about the column.

Type:V[]


Optional

Formats the cell value before rendering.

Type:GridValueFormatter<R, V, F>


Optional

Function that returns specific data to render in the cell instead of using the field value.

Type:GridValueGetter<R, V, F>


Optional

To be used in combination with type: 'singleSelect'. This is an array (or a function returning an array) of the possible cell values and labels.

Type:Array<ValueOptions> | ((params: GridValueOptionsParams<R>) => Array<ValueOptions>)


Optional

Function that takes the user-entered value and converts it to a value used internally.

Type:GridValueParser<R, V, F>


Optional

Function that customizes how the entered value is stored in the row.
Only works with cell/row editing.

Type:GridValueSetter<R, V, F>


Optional

The width of the column in pixels.

Type:number

Default:100