---
id: "T:cAlgo.API.GridColumn"
kind: "interface"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Grid/GridColumn/"
---

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

# GridColumn (interface)

Represents the column of the grid.

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

- CLI: Never available in the CLI: it is only returned by members that do not work there (Grid.AddColumn, Grid.Columns).
- Cloud: Never available in the cloud: it is only returned by members that do not work there (Grid.AddColumn, Grid.Columns).

## Definition

```csharp
public interface GridColumn
```

## Examples

C#:

```csharp
var grid = new Grid(1, 2) { ShowGridLines = true };
GridColumn labelColumn = grid.Columns[0];
labelColumn.SetWidthInPixels(80);
grid.Columns[1].SetWidthInStars(1);
grid.AddChild(new TextBlock { Text = "Symbol" }, 0, 0);
grid.AddChild(new TextBlock { Text = SymbolName }, 0, 1);
Chart.AddControl(grid);
```

Python:

```python
grid = Grid(1, 2)
grid.ShowGridLines = True
labelColumn = grid.Columns[0]
labelColumn.SetWidthInPixels(80)
grid.Columns[1].SetWidthInStars(1)
label = TextBlock()
label.Text = "Symbol"
grid.AddChild(label, 0, 0)
api.Chart.AddControl(grid)
```

## Methods

- `void SetWidthInPixels(double value)` — Sets the grid column width in pixels. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Grid/GridColumn/SetWidthInPixels/index.md)
- `void SetWidthInStars(double stars)` — Sets the grid column width in stars. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Grid/GridColumn/SetWidthInStars/index.md)
- `void SetWidthToAuto()` — Sets the grid column width to automatic. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Grid/GridColumn/SetWidthToAuto/index.md)

## Properties

- `int Index {get;}` — Gets the grid column index. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Grid/GridColumn/Index/index.md)
- `double MaxWidth {get; set;}` — Defines the grid column maximum width. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Grid/GridColumn/MaxWidth/index.md)
- `double MinWidth {get; set;}` — Defines the grid column minimum width. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Grid/GridColumn/MinWidth/index.md)
- `GridLength Width {get;}` — Gets the grid column width. [details](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Grid/GridColumn/Width/index.md)

