Skip to main content
Version: 1.x

@microsoft/fast-foundation > DataGrid

DataGrid class

A Data Grid Custom HTML Element.

  • The default slot for custom row elements
Signature:
export declare class DataGrid extends FoundationElement 

Constructors

ConstructorModifiersDescription
(constructor)()Constructs a new instance of the DataGrid class

Properties

PropertyModifiersTypeDescription
cellItemTemplateViewTemplateThe template used to render cells in generated rows.
columnDefinitionsColumnDefinition[] | nullThe column definitions of the grid
focusColumnIndexnumberThe index of the column that will receive focus the next time the grid is focused. This value changes as focus moves to different rows within the grid. Changing this value when focus is already within the grid moves focus to the specified column.
focusRowIndexnumberThe index of the row that will receive focus the next time the grid is focused. This value changes as focus moves to different rows within the grid. Changing this value when focus is already within the grid moves focus to the specified row.
generateColumnsstatic(row: object) => ColumnDefinition[]generates a basic column definition by examining sample row data
generateHeaderGenerateHeaderOptionsWhether the grid should automatically generate a header row and its type
gridTemplateColumnsstringString that gets applied to the the css gridTemplateColumns attribute of child rows
headerCellItemTemplateViewTemplateThe template used to render header cells in generated rows.
noTabbingbooleanWhen true the component will not add itself to the tab queue. Default is false.
rowElementTagstringSet by the component templates.
rowItemTemplateViewTemplateThe template to use for the programmatic generation of rows
rowsDataobject[]The data being displayed in the grid