# SortingInstruction.SortOrder Property

> Gets or sets the sort order (ascending / descending).

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 26.0
- **Namespace:** `TXTextControl.DocumentServer.DataShaping`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXDocumentServer.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXDocumentServer.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXDocumentServer.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.DocumentServer.DataShaping > SortingInstruction.SortOrder Property
- **392 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datashaping/sortinginstruction/sortorder-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datashaping/sortinginstruction/sortorder-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datashaping/sortinginstruction/sortorder-property/llms-full.txt

---

### Description

Gets or sets the sort order (ascending / descending).

### Syntax

```csharp
public SortOrder SortOrder { get; set; }
```

```vbnet
Public Property SortOrder As SortOrder
```

### Members

| Value | Description |
|---|---|
| Ascending | Ascending sort order. |
| Descending | Descending sort order. |

### Examples

The following example uses `SortingInstruction.SortOrder` to configure sort order as part of the sorting instruction workflow. The configured value is checked before the workflow continues.

```csharp
sortingInstruction.SortOrder = TXTextControl.DocumentServer.DataShaping.SortOrder.Ascending;
Console.WriteLine($"Sort Order used by Sorting Instruction: {sortingInstruction.SortOrder}");
```

```vbnet
sortingInstruction.SortOrder = TXTextControl.DocumentServer.DataShaping.SortOrder.Ascending
Console.WriteLine($"Sort Order used by Sorting Instruction: {sortingInstruction.SortOrder}")
```

---

## Nearby

- **Previous:** [SortingInstruction.OrderBy Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datashaping/sortinginstruction/orderby-property/llms-full.txt)
- **Next:** [TXTextControl.DocumentServer.DataSources namespace](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-documentserver-datasources/llms-full.txt)
