---
title: "Cell Text Selection"
framework: angular
version: "36.1.0"
---

# Cell Text Selection

The grid can be configured to allow simple text selection.

![Cell Text Selection](https://www.ag-grid.com/_astro/cellTextSelection.Cah3lrQ8.png)

## Enabling Cell Text Selection

To enable text selection as if the grid were a regular table, set the grid option `enableCellTextSelection = true`. For the selection to work correctly, the order of the rows within the DOM must match what is displayed by setting the grid option `ensureDomOrder = true`.

#### Cell Text Selection

```ts
import { Component } from "@angular/core";
import { HttpClient } from "@angular/common/http";
import { AgGridAngular } from "ag-grid-angular";
import {
  ClientSideRowModelModule,
  ColDef,
  ColGroupDef,
  GridApi,
  GridOptions,
  GridReadyEvent,
  ModuleRegistry,
  enableDevValidations,
} from "ag-grid-community";
if (process.env.NODE_ENV !== "production") {
  enableDevValidations();
}

ModuleRegistry.registerModules([ClientSideRowModelModule]);
import { IOlympicData } from "./interfaces";

@Component({
  selector: "my-app",
  standalone: true,
  imports: [AgGridAngular],
  template: `<ag-grid-angular
    style="width: 100%; height: 100%;"
    [columnDefs]="columnDefs"
    [enableCellTextSelection]="true"
    [ensureDomOrder]="true"
    [rowData]="rowData"
    (gridReady)="onGridReady($event)"
  /> `,
})
export class AppComponent {
  columnDefs: ColDef[] = [
    { field: "athlete" },
    { field: "sport" },
    { field: "age" },
  ];
  rowData!: IOlympicData[];

  constructor(private http: HttpClient) {}

  onGridReady(params: GridReadyEvent<IOlympicData>) {
    this.http
      .get<
        IOlympicData[]
      >("https://www.ag-grid.com/example-assets/olympic-winners.json")
      .subscribe((data) => (this.rowData = data));
  }
}
```

[Live example: Cell Text Selection](https://www.ag-grid.com/examples/cell-text-selection/cell-text-selection/angular)

When `enableCellTextSelection` is set to `true`, the default [Clipboard](https://www.ag-grid.com/angular-data-grid/clipboard/) behaviour is disabled, and only the selected text is copied.
