<!-- Generated by tools/SharpCell.Grid.Docs from the XML documentation comments. Do not edit; run the tool with 'generate'. -->

# GridViewport

```csharp
public readonly struct GridViewport
```

Namespace `SharpCell.Grid` · package `SharpCell.Grid`

What part of the sheet a grid shows: the scroll offset into the sheet and the size of the whole grid on screen, headers included.

## Constructors

<a id="ctor-double-double-double-double"></a>
### GridViewport(double, double, double, double)

```csharp
public GridViewport(double OffsetX, double OffsetY, double Width, double Height)
```

What part of the sheet a grid shows: the scroll offset into the sheet and the size of the whole grid on screen, headers included.

**Parameters**

- `OffsetX`: How far the cells are scrolled to the left, in pixels.
- `OffsetY`: How far the cells are scrolled up, in pixels.
- `Width`: The width of the grid.
- `Height`: The height of the grid.

## Properties

<a id="height"></a>
### Height

```csharp
public double Height { get; init; }
```

The height of the grid.

<a id="offsetx"></a>
### OffsetX

```csharp
public double OffsetX { get; init; }
```

How far the cells are scrolled to the left, in pixels.

<a id="offsety"></a>
### OffsetY

```csharp
public double OffsetY { get; init; }
```

How far the cells are scrolled up, in pixels.

<a id="width"></a>
### Width

```csharp
public double Width { get; init; }
```

The width of the grid.
