# SerialColumn

> SerialColumn displays a column of row numbers (1-based).

[API reference](/docs/api/index.md) › [CSV Export](/docs/extensions/csv-export/reference/index.md) › SerialColumn

| class | `yii2\extensions\csvexport\SerialColumn` |
| --- | --- |
| Extends | [`Column`](/docs/extensions/csv-export/reference/column/index.md) » [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| Implements | [`yii\base\Configurable`](/docs/api/yii/base/configurable/index.md) |
| Source | [`src/SerialColumn.php`](https://github.com/yii2-extensions/csv-export/blob/main/src/SerialColumn.php#L10) |

SerialColumn displays a column of row numbers (1-based).

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-content"></span>[`$content`](/docs/extensions/csv-export/reference/column/index.md#property-content) | `callable(mixed, mixed, int,` [`Column`](/docs/extensions/csv-export/reference/column/index.md)`): mixed\|null` | This is a callable that will be used to generate the content of each cell. Default: `null`. | [`Column`](/docs/extensions/csv-export/reference/column/index.md) |
| <span id="property-footer"></span>[`$footer`](/docs/extensions/csv-export/reference/column/index.md#property-footer) | `string\|null` | Footer cell content, or `null` to use the exporter fallback. Default: `null`. | [`Column`](/docs/extensions/csv-export/reference/column/index.md) |
| <span id="property-grid"></span>[`$grid`](/docs/extensions/csv-export/reference/column/index.md#property-grid) | [`CsvExporter`](/docs/extensions/csv-export/reference/csvexporter/index.md) | The exporter that owns this column. | [`Column`](/docs/extensions/csv-export/reference/column/index.md) |
| <span id="property-header"></span>`$header` | `string\|null` | The header for the serial column. Default: `'#'`. | `SerialColumn` |
| <span id="property-visible"></span>[`$visible`](/docs/extensions/csv-export/reference/column/index.md#property-visible) | `bool` | Whether this column is visible. Defaults to true. Default: `true`. | [`Column`](/docs/extensions/csv-export/reference/column/index.md) |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| <span id="method-__construct"></span>[`__construct()`](/docs/api/yii/base/baseobject/index.md#method-__construct) | Constructor. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__call"></span>[`__call()`](/docs/api/yii/base/baseobject/index.md#method-__call) | Calls the named method which is not a class method. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__get"></span>[`__get()`](/docs/api/yii/base/baseobject/index.md#method-__get) | Returns the value of an object property. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__isset"></span>[`__isset()`](/docs/api/yii/base/baseobject/index.md#method-__isset) | Checks if a property is set, i.e. defined and not null. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__set"></span>[`__set()`](/docs/api/yii/base/baseobject/index.md#method-__set) | Sets value of an object property. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__unset"></span>[`__unset()`](/docs/api/yii/base/baseobject/index.md#method-__unset) | Sets an object property to null. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-canGetProperty"></span>[`canGetProperty()`](/docs/api/yii/base/baseobject/index.md#method-canGetProperty) | Returns a value indicating whether a property can be read. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-canSetProperty"></span>[`canSetProperty()`](/docs/api/yii/base/baseobject/index.md#method-canSetProperty) | Returns a value indicating whether a property can be set. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-className"></span>[`className()`](/docs/api/yii/base/baseobject/index.md#method-className) static | Returns the fully qualified name of this class. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-getGrid"></span>[`getGrid()`](/docs/extensions/csv-export/reference/column/index.md#method-getGrid) | Returns the exporter that owns this column. | [`Column`](/docs/extensions/csv-export/reference/column/index.md) |
| <span id="method-hasMethod"></span>[`hasMethod()`](/docs/api/yii/base/baseobject/index.md#method-hasMethod) | Returns a value indicating whether a method is defined. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-hasProperty"></span>[`hasProperty()`](/docs/api/yii/base/baseobject/index.md#method-hasProperty) | Returns a value indicating whether a property is defined. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-init"></span>[`init()`](/docs/api/yii/base/baseobject/index.md#method-init) | Initializes the object. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| [`renderDataCellContent()`](#method-renderDataCellContent) | Renders the one-based row number. | `SerialColumn` |
| <span id="method-renderFooterCellContent"></span>[`renderFooterCellContent()`](/docs/extensions/csv-export/reference/column/index.md#method-renderFooterCellContent) | Renders the footer cell using configured text or the exporter fallback. | [`Column`](/docs/extensions/csv-export/reference/column/index.md) |
| <span id="method-renderHeaderCellContent"></span>[`renderHeaderCellContent()`](/docs/extensions/csv-export/reference/column/index.md#method-renderHeaderCellContent) | Renders the header cell using configured text or the exporter fallback. | [`Column`](/docs/extensions/csv-export/reference/column/index.md) |
| <span id="method-setGrid"></span>[`setGrid()`](/docs/extensions/csv-export/reference/column/index.md#method-setGrid) | Sets the exporter that owns this column. | [`Column`](/docs/extensions/csv-export/reference/column/index.md) |

## Method details

### renderDataCellContent() <span id="method-renderDataCellContent"></span>

```php
public function renderDataCellContent(mixed $model, mixed $key, int $index): int
```

Renders the one-based row number.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$model` | `mixed` | Data row; not used. |
| `$key` | `mixed` | Key associated with the data row; not used. |
| `$index` | `int` | Zero-based row index across the export. |

**Returns**

`int`: The row number, starting at 1 and continuing across batches and files.