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

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

# GridColumn.SetWidthInPixels

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

## SetWidthInPixels(double value)

Sets the grid column width in pixels.

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 SetWidthInPixels(double value)
```

Python:

```python
gridColumn.SetWidthInPixels(value: float) -> None
```

### Parameters

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

### Examples

C#:

```csharp
var grid = new Grid(1, 2);
grid.Columns[0].SetWidthInPixels(100);
grid.AddChild(new TextBlock { Text = "Fixed 100 px" }, 0, 0);
Chart.AddControl(grid);
```

Python:

```python
grid = Grid(1, 2)
grid.Columns[0].SetWidthInPixels(100)
textBlock = TextBlock()
textBlock.Text = "Fixed 100 px"
grid.AddChild(textBlock, 0, 0)
api.Chart.AddControl(grid)
```

