---
id: "P:cAlgo.API.OpenFileDialog.AddExtension"
kind: "property"
type: "T:cAlgo.API.OpenFileDialog"
url: "https://help.ctrader.com/ctrader-algo/references/Dialogs/OpenFileDialog/AddExtension/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# OpenFileDialog.AddExtension

Member of [OpenFileDialog](https://help.ctrader.com/ctrader-algo/references/Dialogs/OpenFileDialog/index.md).

## AddExtension

Gets or sets a value indicating whether a file dialog automatically adds an extension to a file name if the user omits an extension.

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: No dialog can be shown in the CLI: ShowDialog returns FileDialogResult.None and the dialog settings are only stored.
- Cloud: No dialog can be shown in the cloud: ShowDialog returns FileDialogResult.None and the dialog settings are only stored.

C#:

```csharp
public bool AddExtension {get; set;}
```

Python:

```python
openFileDialog.AddExtension: bool
```

### Returns

`bool` — 

Available since cAlgo.API 5.1.

### Examples

C#:

```csharp
var openFileDialog = new OpenFileDialog { AddExtension = true, DefaultExt = "csv" };
openFileDialog.ShowDialog();
```

Python:

```python
openFileDialog = OpenFileDialog()
openFileDialog.AddExtension = True
openFileDialog.DefaultExt = "csv"
openFileDialog.ShowDialog()
```

