# ValueSetterParams

Fields, allowed values, and APIs that use ValueSetterParams.

Canonical: https://grid.syidax.com/docs/types/ValueSetterParams/

<a id="definition"></a>

## Type definition

A question mark (?) marks an optional field; readonly marks a value you should not change directly. A union (|) accepts one of the listed forms. Functions are callbacks that Grid invokes at the relevant point.

```typescript
export interface ValueSetterParams<TData = GridData, TValue = unknown, TContext = unknown> {
  newValue: TValue;
  oldValue: TValue;
  field: GridFieldPath<TData>;
  data: TData;
  colDef: ColumnDef<TData, TValue, TContext>;
  context: TContext;
  api: SyGridApi<TData, TContext>;
  rowIndex: number;
  sourceRowIndex?: number;
  colId: string;
}
```

<a id="used-by"></a>

## APIs using this type

- [valueSetter](https://grid.syidax.com/docs/columns/valueSetter.md) — Custom logic for writing a converted value into the source row. Follow the return contract indicating whether a change occurred.

<a id="parents"></a>

## Contracts containing this type

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

<a id="related"></a>

## Related types

- [GridData](https://grid.syidax.com/docs/types/GridData.md)
- [GridFieldPath](https://grid.syidax.com/docs/types/GridFieldPath.md)
- [ColumnDef](https://grid.syidax.com/docs/types/ColumnDef.md)
- [SyGridApi](https://grid.syidax.com/docs/types/SyGridApi.md)
