GridOptions interface is the main configuration object for AG Grid. It controls all aspects of the grid’s behavior, from data binding to UI customization.
Overview
GridOptions is the central configuration point for your grid instance. You provide it when creating the grid, and can update many properties dynamically at runtime.Core Configuration
Column Definitions
Array of column and column group definitions that define the grid’s columns.
Default column definition applied to all columns. Properties in individual column definitions take precedence.
Default column group definition. All column group definitions inherit these properties.
Map of custom column types for reusable column configurations.
Row Data
The data to display in the grid. Each array item represents one row.
Callback to provide unique IDs for rows. Essential for data updates and transactions.
Row Model
Determines how the grid manages row data:
clientSide: All data loaded into the gridinfinite: Lazy loading with infinite scrollserverSide: Server-side operations (grouping, filtering, etc.)viewport: Only render visible rows
Display Options
Layout & Sizing
Layout & Sizing
Controls how the grid sizes itself:
normal: Grid fills the container with scrollbarsautoHeight: Grid expands to fit all rows (no vertical scroll)print: All rows rendered for printing
Height of rows in pixels. If not specified, uses theme default.
Height in pixels for the column header row.
Pagination
Pagination
Editing
Set to
'fullRow' to enable full row editing (all cells editable simultaneously).Enable single-click editing for editable cells.
Stop editing when cells lose focus.
Selection
As of v32.2, row selection uses a new API. See the migration guide for details.
Configure row selection behavior.
Theming
Apply a theme to the grid. Can be a theme object or theme name.
API Access
Getting Grid Options
Access individual grid options at runtime:Updating Grid Options
Some properties marked as
@initial can only be set during grid creation and cannot be updated later.Common Patterns
Basic Grid Setup
Enterprise Features
Server-Side Operations
Type Safety
Provide type information for your row data:Best Practices
- Use defaultColDef - Avoid repetition by setting common column properties once
- Provide getRowId - Essential for efficient data updates and transactions
- Batch updates - Use
updateGridOptions()instead of multiplesetGridOption()calls - Type your data - Use TypeScript generics for better IDE support and type safety
- Module awareness - Check
@agModuletags to ensure required modules are registered
Related
- Column Definitions - Configure individual columns
- Grid API - Interact with the grid programmatically
- Row Data - Manage and update row data