
## add_key(self, key, order) {#int-aspose.cells.SortOrder}

Adds sorted column index and sort order.



```python

def add_key(self, key, order):
    ...
```


| Parameter | Type | Description |
| :- | :- | :- |
| key | int | The sorted column index(absolute position, column A is 0, B is 1, ...) |
| order | aspose.cells.SortOrder | The sort order |


## add_key(self, key, order, custom_list) {#int-aspose.cells.SortOrder-System.String}

Adds sorted column index and sort order with custom sort list.



```python

def add_key(self, key, order, custom_list):
    ...
```


| Parameter | Type | Description |
| :- | :- | :- |
| key | int | The sorted column index(absolute position, column A is 0, B is 1, ...) |
| order | aspose.cells.SortOrder | The sort order. |
| custom_list | System.String | The custom sort list. |


## add_key(self, key, order, custom_list) {#int-aspose.cells.SortOrder-list}

Adds sorted column index and sort order with custom sort list.



```python

def add_key(self, key, order, custom_list):
    ...
```


| Parameter | Type | Description |
| :- | :- | :- |
| key | int | The sorted column index(absolute position, column A is 0, B is 1, ...) |
| order | aspose.cells.SortOrder | The sort order. |
| custom_list | list | The custom sort list. |


## add_key(self, key, type, order, custom_list) {#int-aspose.cells.SortOnType-aspose.cells.SortOrder-System.Object}

Adds sorted column index and sort order with custom sort list.



```python

def add_key(self, key, type, order, custom_list):
    ...
```


| Parameter | Type | Description |
| :- | :- | :- |
| key | int | The sorted column index(absolute position, column A is 0, B is 1, ...) |
| type | aspose.cells.SortOnType | The sorted value type. |
| order | aspose.cells.SortOrder | The sort order. |
| custom_list | System.Object | The custom sort list. |
### Remarks

If type is SortOnType.CellColor or SortOnType.FontColor, the customList is Color.


### See Also
* module [`aspose.cells`](../../)
* class [`DataSorter`](/cells/python-net/aspose.cells/datasorter)
