# GridFilterApi

Canonical page: https://www.adaptabletools.com/docs/reference/gridfilterapi

Provides run-time access to Grid Filter section of Adaptable State.

```ts title="TypeScript"
export interface GridFilterApi 
```

## Methods

| Method | Returns | Description |
| --- | --- | --- |
| [clearGridFilter()](https://www.adaptabletools.com/docs/reference/gridfilterapi.md#cleargridfilter) | `void` | Clears the Grid Filter (for the current Layout) |
| [getCurrentGridFilter()](https://www.adaptabletools.com/docs/reference/gridfilterapi.md#getcurrentgridfilter) | [`GridFilter`](https://www.adaptabletools.com/docs/reference/gridfilter.md)` \| undefined` | Retrieves the Grid Filter from the current Layout |
| [getCurrentGridFilterExpression()](https://www.adaptabletools.com/docs/reference/gridfilterapi.md#getcurrentgridfilterexpression) | `string \| undefined` | Retrieves the Grid Filter&#39;s Expression from the current layout |
| [openUIEditorForGridFilter(expression)](https://www.adaptabletools.com/docs/reference/gridfilterapi.md#openuieditorforgridfilter) | `void` | Opens the Grid Filter Settings Panel (Expression Editor &amp; Query Builder). |
| [reApplyGridFilter()](https://www.adaptabletools.com/docs/reference/gridfilterapi.md#reapplygridfilter) | `void` | Re-applies the Grid Filter |
| [setGridFilterExpression(expression)](https://www.adaptabletools.com/docs/reference/gridfilterapi.md#setgridfilterexpression) | `void` | Sets the Grid Filter (for the current layout)<br/><br/>If `expression` is `null`, `undefined` or a blank string the Grid Filter<br/>is cleared (equivalent to calling ). This makes<br/>it safe to drive the Grid Filter from form-style controls that emit<br/>empty values when the user deselects everything, without having to<br/>branch in the caller. |
| [setGridFilterExpressionUsingNamedQuery(namedQuery)](https://www.adaptabletools.com/docs/reference/gridfilterapi.md#setgridfilterexpressionusingnamedquery) | `void` | Sets the Grid Filter (for the current layout) |
| [suspendGridFilter()](https://www.adaptabletools.com/docs/reference/gridfilterapi.md#suspendgridfilter) | `void` | Suspends the Grid Filter |
| [unSuspendGridFilter()](https://www.adaptabletools.com/docs/reference/gridfilterapi.md#unsuspendgridfilter) | `void` | Unsuspends the Grid Filter |

## Method Details

### clearGridFilter

Clears the Grid Filter (for the current Layout)

```ts title="TypeScript"
clearGridFilter(): void;
```

###### Returns

`void`

### getCurrentGridFilter

Retrieves the Grid Filter from the current Layout

```ts title="TypeScript"
getCurrentGridFilter(): GridFilter | undefined;
```

###### Returns

 Grid Filter

[`GridFilter`](https://www.adaptabletools.com/docs/reference/gridfilter.md)` | undefined`

### getCurrentGridFilterExpression

Retrieves the Grid Filter&#39;s Expression from the current layout

```ts title="TypeScript"
getCurrentGridFilterExpression(): string | undefined;
```

###### Returns

 Grid Filter Expression

`string | undefined`

### openUIEditorForGridFilter

Opens the Grid Filter Settings Panel (Expression Editor &amp; Query Builder).

```ts title="TypeScript"
openUIEditorForGridFilter(expression?: string): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| expression | `string` | unused — kept for API compatibility; editor uses the current Grid Filter |

###### Returns

`void`

### reApplyGridFilter

Re-applies the Grid Filter

```ts title="TypeScript"
reApplyGridFilter(): void;
```

###### Returns

`void`

### setGridFilterExpression

Sets the Grid Filter (for the current layout)

If `expression` is `null`, `undefined` or a blank string the Grid Filter
is cleared (equivalent to calling ). This makes
it safe to drive the Grid Filter from form-style controls that emit
empty values when the user deselects everything, without having to
branch in the caller.

```ts title="TypeScript"
setGridFilterExpression(expression: string | null | undefined): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| expression | `string \| null \| undefined` | filter string, or a falsy value to clear the filter |

###### Returns

`void`

### setGridFilterExpressionUsingNamedQuery

Sets the Grid Filter (for the current layout)

```ts title="TypeScript"
setGridFilterExpressionUsingNamedQuery(namedQuery: NamedQuery): void;
```

###### Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| namedQuery | [`NamedQuery`](https://www.adaptabletools.com/docs/reference/namedquery.md) | : NamedQuery to use |

###### Returns

`void`

### suspendGridFilter

Suspends the Grid Filter

```ts title="TypeScript"
suspendGridFilter(): void;
```

###### Returns

`void`

### unSuspendGridFilter

Unsuspends the Grid Filter

```ts title="TypeScript"
unSuspendGridFilter(): void;
```

###### Returns

`void`
