---
name: "tvSort"
type: command
status: ok
groups: ["GUI Control - Tree View"]
arma3_since: "0.74"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/tvSort
revid: 377597
updated: 2026-01-02T07:01:07Z
---

# tvSort

*Command · GUI Control - Tree View · Arma 3 v0.74*

## Description

Sorts all children of given path. Text of Tree View entries is used for sorting.

## Syntax

### Syntax 1

```sqf
control tvSort [path, reversed]
```

**Parameters:**

- `control`: [Control](../topics/Control.md)
- `path`: [Tree View Path](../topics/Tree_View_Path.md) - the parent item to sort
- `reversed`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) [true](../commands/true.md) to reverse sort it

**Returns:** [Nothing](../topics/Nothing.md)

### Syntax 2

```sqf
tvSort [idc, path, reversed]
```

**Parameters:**

- `idc`: [Number](../topics/Number.md) - control idc
- `path`: [Tree View Path](../topics/Tree_View_Path.md) - the parent item to sort
- `reversed`: [Boolean](../topics/Boolean.md) - (Optional, default [false](../commands/false.md)) [true](../commands/true.md) to reverse sort it

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

```sqf
control tvSort [[0], true];
```

### Example 2

```sqf
tvSort [102, [0], true];
```

## See also

[lbSortBy](../commands/lbSortBy.md) · [lnbSortBy](../commands/lnbSortBy.md) · [tvSortAll](../commands/tvSortAll.md) · [tvSortByValue](../commands/tvSortByValue.md) · [tvSortByValueAll](../commands/tvSortByValueAll.md)

<sub>Source: [BI Community Wiki — tvSort](https://community.bistudio.com/wiki/tvSort) (revision 377597).</sub>
