Basic Usage
Walk through the fundamentals of using gp-grid in Angular, from defining columns and providing data to wiring up the Grid component in your first page.
This page is being written. The React Basic Usage and Vue Basic Usage pages cover the same concepts: props, column definitions, and data types are identical across bindings.
Don't forget to import the stylesheet in your global styles.css:
@import "@gp-grid/angular/dist/styles.css";Minimal Example
import { Component } from "@angular/core";
import { GpGridComponent, type ColumnDefinition } from "@gp-grid/angular";
@Component({
selector: "app-my-grid",
standalone: true,
imports: [GpGridComponent],
template: `
<div style="width: 100%; height: 400px">
<gp-grid
[columns]="columns"
[rowData]="data"
[rowHeight]="36"
/>
</div>
`,
})
export class MyGridComponent {
columns: ColumnDefinition[] = [
{ field: "id", cellDataType: "number", width: 80, headerName: "ID" },
{ field: "name", cellDataType: "text", width: 200, headerName: "Name" },
];
data = [
{ id: 1, name: "Giovanni Rossi" },
{ id: 2, name: "Luca Verdi" },
];
}Next Steps
- Explore the Guides
- See the API Reference
Angular migration to version 1.0
Migrate the Angular gp-grid wrapper from 0.23.x to 1.0 with before-and-after examples for public exports, output events, column state, core access, and writes.
Guides Overview
Explore gp-grid Angular guides with interactive demos and code examples for sorting, editing, grouping, pivoting, styling, performance, and server-side data.