Highlighting
Highlight rows, columns, and individual cells inside the Angular grid using conditional rules, hover styling, and custom CSS class overrides per cell.
This example demonstrates the highlighting API using computeRowClasses, computeColumnClasses, and computeCellClasses to create dynamic hover effects.
Interactive Demo
Use the toggle buttons to switch between different highlighting modes:
Angular-specific code samples below. The callback signatures are identical across framework bindings.
Row Highlighting
import { Component } from "@angular/core";
import { GridComponent, type ColumnDefinition } from "@gp-grid/angular";
@Component({
selector: "app-highlighted-grid",
standalone: true,
imports: [GridComponent],
template: `
<div style="height: 400px">
<gp-grid
[columns]="columns"
[rowData]="data"
[rowHeight]="36"
[computeRowClasses]="computeRowClasses"
/>
</div>
`,
})
export class HighlightedGridComponent {
columns: ColumnDefinition[] = [/* ... */];
data = [/* ... */];
computeRowClasses = ({ hoveredRowIndex, rowIndex }: {
hoveredRowIndex: number | null;
rowIndex: number;
}) => (rowIndex === hoveredRowIndex ? "row-highlight" : "");
}Custom Renderers
Render custom Angular components inside grid cells and headers, including badges, charts, action menus, and any other interactive UI you need to embed.
Column Dragging
Let users reorder columns in the Angular grid by dragging their headers, with persistent ordering, locked columns, and reset-to-default support today.