# DataSet

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

Defines a Data Set object that can provide data to AdapTable

```ts title="TypeScript"
export interface DataSet<TData = any> extends AdaptableObject 
```

###### Extends

[`AdaptableObject`](https://www.adaptabletools.com/docs/reference/adaptableobject.md)

## Properties

| Property | Type | Description | Default |
| --- | --- | --- | --- |
| [description](https://www.adaptabletools.com/docs/reference/dataset.md#description) | `string` | Describes the Data Set |   |
| [form](https://www.adaptabletools.com/docs/reference/dataset.md#form) | [`AdaptableForm`](https://www.adaptabletools.com/docs/reference/adaptableform.md)`<`[`DataSetFormContext`](https://www.adaptabletools.com/docs/reference/datasetformcontext.md)`>` | Params for Data Set popup form |   |
| [info](https://www.adaptabletools.com/docs/reference/dataset.md#info) | `Record<string, string \| number \| boolean \| Date>` | Additional info for Data Set |   |
| [loadData](https://www.adaptabletools.com/docs/reference/dataset.md#loaddata) | `(info: `[`DataSetSelectedInfo`](https://www.adaptabletools.com/docs/reference/datasetselectedinfo.md)`) => TData[] \| Promise<TData[]>` | Optional shortcut that loads row data into the Grid when this Data Set is<br/>selected (only when no `form` is defined). Runs before `onSelect`. | undefined |
| [name](https://www.adaptabletools.com/docs/reference/dataset.md#name) | `string` | Name of Data Set |   |
| [onFormSubmit](https://www.adaptabletools.com/docs/reference/dataset.md#onformsubmit) | `(context: `[`DataSetFormContext`](https://www.adaptabletools.com/docs/reference/datasetformcontext.md)`) => void \| Promise<void>` | Invoked when the user submits the Data Set form (Enter key or form button).<br/>When no form `buttons` are defined, an OK button is added automatically. | undefined |
| [onSelect](https://www.adaptabletools.com/docs/reference/dataset.md#onselect) | `(info: `[`DataSetSelectedInfo`](https://www.adaptabletools.com/docs/reference/datasetselectedinfo.md)`) => void \| Promise<void>` | Invoked when this Data Set is selected and it does not define a `form`.<br/><br/>Use for custom loading logic (e.g. server requests). The `DataSetSelected`<br/>event is still fired for backward compatibility. | undefined |
| [IsReadOnly](https://www.adaptabletools.com/docs/reference/dataset.md#isreadonly) | `boolean` | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of &#39;Full&#39;) |   |

## Property Details

### description

Describes the Data Set

```ts title="TypeScript"
description: string;
```

###### Property Value

`string`

### form

Params for Data Set popup form

```ts title="TypeScript"
form?: AdaptableForm<DataSetFormContext>;
```

###### Property Value

[`AdaptableForm`](https://www.adaptabletools.com/docs/reference/adaptableform.md)`<`[`DataSetFormContext`](https://www.adaptabletools.com/docs/reference/datasetformcontext.md)`>`

### info

Additional info for Data Set

```ts title="TypeScript"
info?: Record<string, string | number | boolean | Date>;
```

###### Property Value

`Record<string, string | number | boolean | Date>`

### loadData

Optional shortcut that loads row data into the Grid when this Data Set is
selected (only when no `form` is defined). Runs before `onSelect`.

```ts title="TypeScript"
loadData?: (info: DataSetSelectedInfo) => TData[] | Promise<TData[]>;
```

###### Default Value

undefined

###### Property Value

`(info: `[`DataSetSelectedInfo`](https://www.adaptabletools.com/docs/reference/datasetselectedinfo.md)`) => TData[] | Promise<TData[]>`

### name

Name of Data Set

```ts title="TypeScript"
name: string;
```

###### Property Value

`string`

### onFormSubmit

Invoked when the user submits the Data Set form (Enter key or form button).
When no form `buttons` are defined, an OK button is added automatically.

```ts title="TypeScript"
onFormSubmit?: (context: DataSetFormContext) => void | Promise<void>;
```

###### Default Value

undefined

###### Property Value

`(context: `[`DataSetFormContext`](https://www.adaptabletools.com/docs/reference/datasetformcontext.md)`) => void | Promise<void>`

### onSelect

Invoked when this Data Set is selected and it does not define a `form`.

Use for custom loading logic (e.g. server requests). The `DataSetSelected`
event is still fired for backward compatibility.

```ts title="TypeScript"
onSelect?: (info: DataSetSelectedInfo) => void | Promise<void>;
```

###### Default Value

undefined

###### Property Value

`(info: `[`DataSetSelectedInfo`](https://www.adaptabletools.com/docs/reference/datasetselectedinfo.md)`) => void | Promise<void>`

### IsReadOnly

> *Inherited from [AdaptableObject](https://www.adaptabletools.com/docs/reference/adaptableobject.md)*

Sets Entity to ReadOnly (overwriting a Strategy Entitlement of &#39;Full&#39;)

```ts title="TypeScript"
IsReadOnly?: boolean;
```

###### Property Value

`boolean`
