# setColumnPinned

Pins a column left/right or unpins it.

Canonical: https://grid.syidax.com/docs/methods/setColumnPinned/

<a id="meaning"></a>

## What does this API do?

Pins a column left/right or unpins it.

<a id="contract"></a>

## Exact input and result types

```typescript
setColumnPinned(field: string, side: ColumnPinSide | null): Promise<void>
```

| Arguments | Required | Type |
| --- | --- | --- |
| field | Required | string |
| side | Required | ColumnPinSide \| null |

The return type is `Promise<void>`.

<a id="usage"></a>

## Usage flow

After registering and initializing the Grid element, call grid.setColumnPinned(…). Read the return value with await. For methods returning a boolean or report, inspect the result before continuing.

<a id="types"></a>

## Read related types

- [ColumnPinSide](https://grid.syidax.com/docs/types/ColumnPinSide.md)

<a id="recipes"></a>

## Feature explanations and examples

- [Column sizing and pinning](https://grid.syidax.com/docs/features/column-operations.md) — Width, order, pinning, and visibility are independent column states. Combine them to pin order IDs, hide supporting information, and widen long product names.
