Angular React Web Components Blazor Web Components
Ignite UIfor Web Components
AI-Assisted Development
Agent Workflow
New, New
Agent Skills
New, New
CLI MCP
New, New
Theming MCP
New, New
Maker Framework
New, New
General
Getting Started
Localization(i18n)
New, New
Open-Source vs Premium
New, New
Ignite UI CLI
Overview
Step-by-Step Guide Using Ignite UI CLI
New, New
Licensing
How to
Build App with CLI MCP and Theming MCP
New, New
Changelog
Updated, Updated
Interactivity
Accessibility Compliance
Grids & Lists
Overview
, Premium
Grid
Overview
Cell Merging
New, New, Premium
Clipboard Interactions
, Premium
Collapsible Column Groups
Updated, Updated, Premium
Column Hiding
Updated, Updated, Premium
Column Moving
, Premium
Column Pinning
Updated, Updated, Premium
Column Resizing
, Premium
Column Types
, Premium
Conditional Styling
, Premium
Editing
Overview
Cell Editing
, Premium
Cascading Combos
, Premium
Row Adding
, Premium
Row Editing
, Premium
Exporting
Updated, Updated, Premium
Filtering
Overview
Advanced Filtering
, Premium
Excel Style Filtering
, Premium
Group By
, Premium
Live Data / Real-Time
, Premium
Master-Detail
, Premium
Keyboard navigation
, Premium
Multi-Column Headers
, Premium
Toolbar
, Premium
Multi-Row Layout
, Premium
Paging
, Premium
Paste from Excel
, Premium
Remote Data Operations
, Premium
Row Actions
, Premium
Row Dragging
, Premium
Row Pinning
, Premium
Search
, Premium
Selection
Overview
Cell Selection
, Premium
Column Selection
, Premium
Row Selection
, Premium
Size
, Premium
Sizing
, Premium
Sorting
, Premium
State Persistence
, Premium
Summaries
, Premium
Virtualization and performance
, Premium
Customize Icons
, Premium
Hierarchical Grid
Overview
, Premium
Cell Merging
New, New, Premium
Collapsible Column Groups
, Premium
Column Hiding
Updated, Updated, Premium
Column Moving
, Premium
Column Pinning
Updated, Updated, Premium
Column Resizing
, Premium
Column Types
, Premium
Conditional Styling
, Premium
Editing
Overview
Cell Editing
, Premium
Row Adding
, Premium
Row Editing
, Premium
Exporting
Updated, Updated, Premium
Filtering
Overview
Advanced Filtering
, Premium
Excel Style Filtering
, Premium
Multi-Column Headers
, Premium
Remote Data Operations
, Premium
Row Actions
, Premium
Row Dragging
, Premium
Row Pinning
, Premium
Selection
Overview
Cell Selection
, Premium
Column Selection
, Premium
Row Selection
, Premium
Size
, Premium
Sizing
, Premium
Sorting
, Premium
State Persistence
, Premium
Summaries
, Premium
Toolbar
, Premium
Virtualization and performance
, Premium
Load on Demand
, Premium
Pivot Grid
Overview
, Premium
State Persistence
, Premium
Remote Operations
, Premium
Tree Grid
Overview
, Premium
Cell Merging
New, New, Premium
Clipboard Interactions
, Premium
Collapsible Column Groups
, Premium
Column Types
, Premium
Conditional Styling
, Premium
Column Hiding
Updated, Updated, Premium
Column Moving
, Premium
Column Pinning
Updated, Updated, Premium
Column Resizing
, Premium
Editing
Overview
Cell Editing
, Premium
Row Adding
, Premium
Row Editing
, Premium
Exporting
Updated, Updated, Premium
Filtering
Overview
Advanced Filtering
, Premium
Excel Style Filtering
, Premium
Keyboard navigation
, Premium
Multi-Column Headers
, Premium
Paging
, Premium
Row Actions
, Premium
Row Dragging
, Premium
Row Pinning
, Premium
Search
, Premium
Selection
Overview
Cell Selection
, Premium
Column Selection
, Premium
Row Selection
, Premium
Size
, Premium
Sizing
, Premium
Sorting
, Premium
State Persistence
, Premium
Summaries
, Premium
Toolbar
, Premium
Virtualization and performance
, Premium
Load On Demand
, Premium
Live Data / Real-Time
, Premium
Grid Lite
Overview
Column Configuration
Overview
Cell Template
New, New
Header Template
New, New
Data Binding
New, New
Filtering
New, New
Sorting
New, New
Theming
New, New
List
Tree
Spreadsheet
Overview
, Premium
Activation
, Premium
Chart Adapter
, Premium
Clipboard
, Premium
Conditional Formatting
, Premium
Configuring Spreadsheet
, Premium
Commands
, Premium
Data Validation
, Premium
Hyperlinks
, Premium
Excel Utility
, Premium
Dashboards
Dashboard Tile
Preview, Preview, Premium
Charts
Overview
, Premium
Area Chart
, Premium
Bar Chart
Updated, Updated, Premium
Bubble Chart
, Premium
Column Chart
, Premium
Composite Chart
, Premium
Data Pie Chart
New, New, Premium
Donut Chart
, Premium
Financial / Stock Chart
, Premium
Line Chart
Updated, Updated, Premium
Pie Chart
, Premium
Point Chart
, Premium
Polar Chart
, Premium
Radial Chart
, Premium
Scatter Chart
, Premium
Shape Chart
, Premium
Spline Chart
, Premium
Sparkline Chart
, Premium
Stacked Chart
, Premium
Step Chart
, Premium
Treemap
Updated, Updated, Premium
Chart API
Updated, Updated, Premium
Chart Features
Overview
Axis Gridlines
Updated, Updated, Premium
Axis Layouts
, Premium
Axis Options
, Premium
Axis Types
, Premium
Chart Animations
, Premium
Chart Annotations
, Premium
Chart Data Annotations
Preview, Preview, Premium
Charting in Dashboards
Preview, Preview, Premium
Chart Data Aggregations
, Premium
Chart Data Filtering
, Premium
Chart Data Legend
Updated, Updated, Premium
Chart Data Tooltip
Updated, Updated, Premium
Chart Data Selection
, Premium
Chart Highlight Filter
, Premium
Chart Highlighting
, Premium
Chart Markers
Updated, Updated, Premium
Chart Navigation
, Premium
Chart Overlays
Updated, Updated, Premium
Chart Performance
, Premium
Chart Synchronization
, Premium
Chart Tooltips
, Premium
Chart Trendlines
Updated, Updated, Premium
Chart User Annotations
Preview, Preview, Premium
Maps
Overview
, Premium
Geographic Area Map
, Premium
Geographic Contour Map
, Premium
Geographic High Density Map
, Premium
Geographic Bubble Map
, Premium
Geographic Symbol Map
, Premium
Geographic Polygon Map
, Premium
Geographic Polyline Map
, Premium
Geographic Map API
, Premium
Geographic Map Features
Overview
Binding CSV File
, Premium
Binding JSON File
, Premium
Binding Data Model
, Premium
Binding Shape File
, Premium
Binding Multiple Shapes
, Premium
Binding Multiple Sources
, Premium
Displaying Azure Imagery
, Premium
Displaying Bing Imagery
, Premium
Displaying Esri Imagery
, Premium
Displaying Heat Imagery
, Premium
Displaying OSM Imagery
, Premium
Navigating Map Content
, Premium
Shape Files Reference
, Premium
Shape Styling
, Premium
Shape Styling Utility
, Premium
Esri Utility
, Premium
World Connections
, Premium
World Locations
, Premium
World Utility
, Premium
Layouts
Accordion
Avatar
Card
Carousel
New, New
Dock Manager
Overview
Using Panes
, Premium
Embedding Frames
, Premium
Desktop Integration
, Premium
Customization
Updated, Updated, Premium
Expansion Panel
Stepper
Tabs
Divider
New, New
Splitter
New, New
Tile Manager
New, New
Menus
Toolbar
Updated, Updated, Premium
Navbar
Navigation Drawer
Frameworks
Excel Library
Overview
Using Cells
, Premium
Using Tables
, Premium
Using Workbooks
, Premium
Using Worksheets
, Premium
Working with Charts
, Premium
Working with Sparklines
, Premium
Excel Utility
, Premium
Gauges
Bullet Graph
, Premium
Linear Gauge
, Premium
Radial Gauge
, Premium
Data Entry & Display
Badge
Button
Button Group
Checkbox
Circular Progress
New, New
Linear Progress
New, New
Chip
Color Editor
Preview, Preview, Premium
Combo Box
Overview
Features
Templates
Single Selection
Dropdown
Icon
Icon Button
Input
File Input
New, New
Mask Input
New, New
Date Time Input
Radio & Radio Group
Select
Rating
Switch
Text Area
Highlight
Interactions
Chat
New, New
Ripple
Tooltip
New, New
Slider & Range Slider
Zoom Slider
Query Builder
New, New
Notifications
Banner
Snackbar
Toast
Dialog
Scheduling
Calendar
Date Picker
Date Range Picker
New, New
Styling & Themes
Overview
Configuration
Elevations
Palettes
Typography
Styles
Custom Tailwind Classes
New, New
Premium
Web Components Data Grid Documentation
The Web Components Data Grid component is used for displaying large volumes of data. Modern and more complex grids ensure smooth UX and bring an array of features for manipulating tabular data. There is an intuitive API, theming, branding, filtering, sorting, data selection, Excel-style filtering, and many more.
The Ignite UI for Web Components Data Table / Data Grid is a tabular Web Components grid component that allows you to quickly bind and display your data with little coding or configuration. Features of the Web Components data grid in our toolbox include filtering, sorting, templates, row selection, row grouping, row pinning, movable columns, virtualization, Master-Detail, and much more.
The Web Components tables are optimized for speed and performance, with the ability to handle millions of rows and columns, and real-time updates in an instant.
Web Components Data Grid Example
In this Ignite UI for Web Components Grid example, you can see how users can do both basic and excel-style filtering, live-data sorting, and use grid summaries as well as cell templating. The demo also includes paging set to display 10 items per page.
Getting Started with Web Components Data Grid
Dependencies
To get started with the Web Components Data Grid, first you need to install the igniteui-webcomponents-grids package.
npm install --save igniteui-webcomponents-grids
You also need to include the following import to use the grid:
The corresponding styles should also be referenced. You can choose light or dark option for one of the themes and based on your project configuration to import it:
constructor() { let grid1 = document.getElementById("grid1") as IgcGridComponent; grid1.data = data;}
The Id property is a string value and is the unique identifier of the grid which will be auto-generated if not provided, while data binds the grid, in this case to local data.
The AutoGenerate property tells the grid to auto generate the grid’s Column components based on the data source fields. It will also try to deduce the appropriate data type for the column if possible. Otherwise, the developer needs to explicitly define the columns and the mapping to the data source fields.
Editable Web Components Grid
Each operation for grid editing includes batch operations, meaning the API gives you the option to group edits into a single server call, or you can perform grid edit / update operations as they occur with grid interactions. Along with a great developer experience as an editable grid with CRUD operations, the grid includes Excel-like keyboard navigation. Common default grid navigation is included, plus the option to override any navigation option to meet the needs of your customers. An editable grid in with a great navigation scheme is critical to any modern line of business application, with the Ignite UI grid we make it easy.
Column is used to define the grid’s columns collection and to enable features per column like sorting and filtering. Cell, header, and footer templates are also available.
Defining Columns
Let’s turn the AutoGenerate property off and define the columns collection in the markup:
When cell template is set it changes all the cells in the column. The context object provided in the template consists of the cell value provided implicitly and the cell object itself. It can be used to define a template where the cells’ text could be formatted e.g. as title case.
<igc-column id="name" field="Name"></igc-column>
constructor() { var name = this.name = document.getElementById('name') as IgcColumnComponent; name.bodyTemplate = this.nameCellTemplate;}public nameCellTemplate = (ctx: IgcCellTemplateContext) => { return html` ${this.formatTitleCase(ctx.implicit)} `;}public formatTitleCase(value: string) { return value.toLowerCase().replace(/\b\w/g, c => c.toUpperCase());}
In the snippet above we take a reference to the implicitly provided cell value. This is sufficient if you just want to present some data and maybe apply some custom styling or pipe transforms over the value of the cell. However even more useful is to take the Cell instance itself as shown below:
constructor() { var grid = this.grid = document.getElementById('grid') as IgcGridComponent; var name = this.name = document.getElementById('name') as IgcColumnComponent; var subscription = this.subscription = document.getElementById('subscription') as IgcColumnComponent; grid.data = this.data; name.bodyTemplate = this.nameCellTemplate; subscription.bodyTemplate = this.subscriptionCellTemplate;}public nameCellTemplate = (ctx: IgcCellTemplateContext) => { return html` <span tabindex="0" @keydown="${() => this.deleteRow(ctx.cell.id.rowIndex)}">${this.formatTitleCase(ctx.cell.value)}</span> `;}public subscriptionCellTemplate = (ctx: IgcCellTemplateContext) => { if (ctx.cell.value) { return html` <input type="checkbox" checked /> `; } else { return html` <input type="checkbox"/> `; }}public deleteRow(rowIndex: number) { this.grid.deleteRow(rowIndex);}public formatTitleCase(value: string) { return value.toLowerCase().replace(/\b\w/g, c => c.toUpperCase());}
Note:
The grid exposes a default handling for number, string, date and boolean column types. For example, the column will display check or close icon, instead of true/false by default, for boolean column type.
When properly implemented, the cell editing template also ensures that the cell’s EditValue will correctly pass through the grid editing event cycle.
Cell Editing Template
The column also accepts one last template that will be used when a cell is in edit mode. As with the other column templates, the provided context object is again the cell value and the cell object itself. Of course in order to make the edit-mode template accessible to end users, you need
to set the Editable property of the column to true.
constructor() { var price = this.price = document.getElementById('price') as IgcColumnComponent; price.inlineEditorTemplate = this.priceCellTemplate;}public priceCellTemplate = (ctx: IgcCellTemplateContext) => { return html` <label> Enter the new price tag </label> <input name="price" type="number" value="${ctx.cell.value}" @change="${() => this.updateValue(ctx.cell.value)}" /> `;}public updateValue(value: number) {}
Make sure to check the API for the IgcCellType in order to get accustomed with the provided properties you can use in your templates.
Column Template API
Each of the column templates can be changed programmatically at any point through the Column object itself. For example in the code below, we have declared two templates for our user data. In our TypeScript code we’ll get references to the templates themselves and then based on some condition we will render the appropriate template for the column in our application.
var user = this.user = document.getElementById('user') as IgcColumnComponent;// Return the appropriate template based on some condition.// For example saved user settings, viewport size, etc.user.bodyTemplate = this.smallView;public normalViewTemplate = (ctx: IgcCellTemplateContext) => { return html` <div class="user-details">${ ctx.cell.value }</div> <user-details-component></user-details-component> `;}public smallViewTemplate = (ctx: IgcCellTemplateContext) => { return html` <div class="user-details-small">${ ctx.cell.value }</div> `;}
Column properties can also be set in code in the ColumnInit event which is emitted when the columns are initialized in the grid.
public initColumns(column: IgcGridColumn) { if (column.field === 'ProductName') { column.sortable = true; column.editable = true; }}
The code above will make the ProductName column sortable and editable and will instantiate the corresponding features UI (like inputs for editing, etc.).
Custom Display Format
There are optional parameters for formatting:
Format - determines what date/time parts are displayed, defaults to 'mediumDate', equivalent to ‘MMM d, y’
Timezone - the timezone offset for dates. By default uses the end-user’s local system timezone
DigitsInfo - decimal representation objects. Default to 1.0-3
To allow customizing the display format by these parameters, the PipeArgs input is exposed. A column will respect only the corresponding properties for its data type, if PipeArgs is set. Example:
If you use AutoGenerate columns the data keys must be identical.
Grid Data Binding
Our Web Components Data Grid provides unmatched data binding options and is optimized for real-time updates and smooth scrolling. With low-latency rendering, the grid ensures any UI change is displayed in an instant, including live streaming data, large datasets, and more.
Before going any further with the Web Components Data Grid we want to change the grid to bind to remote data service, which is the common scenario in large-scale applications.
You can do this by fetching the data from a given url receiving a JSON response and assigning it to the grid’s data property that is used as the grid’s data source:
<igc-grid id="grid1"></igc-grid>
public fetchData(url: string): void { fetch(url) .then(response => response.json()) .then(data => this.onDataLoaded(data));}public onDataLoaded(jsonData: any[]) { var grid1 = document.getElementById("grid1") as IgcGridComponent; grid1.data = jsonData;}
Note: The grid AutoGenerate property is best to be avoided when binding to remote data for now. It assumes that the data is available in order to inspect it and generate the appropriate columns. This is usually not the case until the remote service responds, and the grid will throw an error. Making AutoGenerate available, when binding to remote service, is on our roadmap for future versions.
Complex Data Binding
Complex Data Binding allows for seamless interaction with multi-level data, complex, real-world datasets, object-oriented data modules, etc. Using our Web Components Data Grid, you can easily bind to complex objects (including data structures that nest deeper than one level). This happens through a path of properties in the data record.
An alternative way to bind complex data, or to visualize composite data (from more than one column) in the Grid is to use a custom body template for the column. Generally, one can:
use the value of the cell, that contains the nested data
use the cell object in the template, from which to access the ctx.cell.id.rowIndex or ctx.cell.id.rowID to get the row via the grid’s API and retrieve any value from it and interpolate those in the template.
The flat data binding approach is similar to the one that we already described above, but instead of cell value we are going to use the Data property of the IgcGridRowComponent.
Since the Web Components grid is a component for rendering, manipulating and preserving data records, having access to every data record gives you the opportunity to customize the approach of handling it. The data property provides you this opportunity.
Using code snippets from previous section will result in the following example of Grid
Keyboard Navigation
Keyboard navigation of the Grid provides a rich variety of keyboard interactions for the user. It enhances accessibility and allows intuitive navigation through any type of elements inside (cell, row, column header, toolbar, footer, etc.).
Styling Web Components Grid
Note:
The grid uses css grid layout, which is not supported in IE without prefixing, consequently it will not render properly.
In addition to the predefined themes, the grid could be further customized by setting some of the available CSS properties. In case you would like to change the header background and text color, you need to set a class for the grid first:
<igc-grid class="grid"></igc-grid>
Then set the --header-background and --header-text-color CSS properties for that class:
Currently we do not support mixing of column widths with % and px.
When trying to filter a column of type number
If a value different than number is entered into the filtering input, NaN is returned due to an incorrect cast.
Grid width does not depend on the column widths
The width of all columns does not determine the spanning of the grid itself. It is determined by the parent container dimensions or the defined grid’s width.
Grid nested in parent container
When grid’s width is not set and it is placed in a parent container with defined dimensions, the grid spans to this container.
Columns have a minimum allowed column width. Depending on the --ig-size CSS variable, they are as follows: “small”: 56px “medium”: 64px “large ”: 80px
If width less than the minimum allowed is set it will not affect the rendered elements. They will render with the minimum allowed width for the corresponding --ig-size. This may lead to an unexpected behavior with horizontal virtualization and is therefore not supported.
Row height is not affected by the height of cells that are not currently rendered in view.
Because of virtualization a column with a custom template (that changes the cell height) that is not in the view will not affect the row height. The row height will be affected only while the related column is scrolled in the view.
API References
Theming Dependencies
Icon Theme
InputGroup Theme
Chip Theme
Ripple Theme
Button Theme
Overlay Theme
DropDown Theme
Calendar Theme
SnackBar Theme
Badge Theme
Our community is active and always welcoming to new ideas.