---
id: "M:cAlgo.API.GridColumn.SetWidthInStars(System.Double)"
kind: "method"
type: "T:cAlgo.API.GridColumn"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Grid/GridColumn/SetWidthInStars/"
---

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

# GridColumn.SetWidthInStars

Member of [GridColumn](https://help.ctrader.com/ctrader-algo/references/Controls/Layout/Grid/GridColumn/index.md).

## SetWidthInStars(double stars)

Sets the grid column width in stars.

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).

C#:

```csharp
void SetWidthInStars(double stars)
```

Python:

```python
gridColumn.SetWidthInStars(stars: float) -> None
```

### Parameters

- `stars` (`double`, Python `float`): The stars.

### Examples

C#:

```csharp
var grid = new Grid(1, 2) { Width = 300 };
grid.Columns[0].SetWidthInStars(1);
grid.Columns[1].SetWidthInStars(2);
Chart.AddControl(grid);
```

Python:

```python
grid = Grid(1, 2)
grid.Width = 300
grid.Columns[0].SetWidthInStars(1)
grid.Columns[1].SetWidthInStars(2)
api.Chart.AddControl(grid)
```

