---
product: "AG Grid"
title: "Cell Text Selection"
description: "The grid can be configured to allow simple text selection."
framework: javascript
version: "36.2.0"
related:
    - title: "Cell Content"
      url: "https://www.ag-grid.com/archive/36.2.0/javascript-data-grid/cell-content/"
    - title: "Find"
      url: "https://www.ag-grid.com/archive/36.2.0/javascript-data-grid/find/"
    - title: "Notes"
      url: "https://www.ag-grid.com/archive/36.2.0/javascript-data-grid/notes/"
    - title: "Styling Cells"
      url: "https://www.ag-grid.com/archive/36.2.0/javascript-data-grid/cell-styles/"
    - title: "Highlighting Changes"
      url: "https://www.ag-grid.com/archive/36.2.0/javascript-data-grid/change-cell-renderers/"
    - title: "Tooltips"
      url: "https://www.ag-grid.com/archive/36.2.0/javascript-data-grid/tooltips/"
    - title: "Expressions"
      url: "https://www.ag-grid.com/archive/36.2.0/javascript-data-grid/cell-expressions/"
    - title: "View Refresh"
      url: "https://www.ag-grid.com/archive/36.2.0/javascript-data-grid/view-refresh/"
    - title: "Reference Data"
      url: "https://www.ag-grid.com/archive/36.2.0/javascript-data-grid/reference-data/"
llms: "https://www.ag-grid.com/archive/36.2.0/llms.txt"
---

# Cell Text Selection

The grid can be configured to allow simple text selection.

![Cell Text Selection](https://www.ag-grid.com/archive/36.2.0/_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 {
  ClientSideRowModelModule,
  GridApi,
  GridOptions,
  ModuleRegistry,
  createGrid,
  enableDevValidations,
} from "ag-grid-community";
import { IOlympicData } from "./interfaces";

if (process.env.NODE_ENV !== "production") {
  // Enable extended validations only for development
  enableDevValidations();
}

ModuleRegistry.registerModules([ClientSideRowModelModule]);

let gridApi: GridApi<IOlympicData>;

const gridOptions: GridOptions<IOlympicData> = {
  columnDefs: [{ field: "athlete" }, { field: "sport" }, { field: "age" }],
  enableCellTextSelection: true,
  ensureDomOrder: true,
};

const gridDiv = document.querySelector<HTMLElement>("#myGrid")!;
gridApi = createGrid(gridDiv, gridOptions);

fetch("https://www.ag-grid.com/example-assets/olympic-winners.json")
  .then((response) => response.json())
  .then((data: IOlympicData[]) => gridApi!.setGridOption("rowData", data));
```

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

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