# GridLine

> A single placement value for grid-column-start, grid-column-end, grid-row-start and grid-row-end: auto, an explicit line (an integer \>= 1), or span <n> (n \>= 1).

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine.UIElements](/engine/6000.7/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule
* **Implements:** [IEquatable\<GridLine>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

```csharp
public readonly struct GridLine : IEquatable<GridLine>
```

## Remarks

The value is sign-encoded into a single blittable int so it mirrors the native field 1:1: `0` = auto, `> 0` = line, `< 0` = span(-value). This mirrors how aspect-ratio uses a sentinel value rather than a separate flag.

## Properties

| Property                                                                                  | Description                                                                                                                             |
| ----------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| [isAuto](/engine/6000.7/script-reference/unityengine/uielements/gridline/isauto.md)       | Whether this value is `auto`.                                                                                                           |
| [isLine](/engine/6000.7/script-reference/unityengine/uielements/gridline/isline.md)       | Whether this value is an explicit line.                                                                                                 |
| [isSpan](/engine/6000.7/script-reference/unityengine/uielements/gridline/isspan.md)       | Whether this value is a span.                                                                                                           |
| [line](/engine/6000.7/script-reference/unityengine/uielements/gridline/line.md)           | The 1-based line index when [\_isLine](/engine/6000.7/script-reference/unityengine/uielements/gridline/isline.md) is true; otherwise 0. |
| [placement](/engine/6000.7/script-reference/unityengine/uielements/gridline/placement.md) | Which kind of placement this value represents.                                                                                          |
| [span](/engine/6000.7/script-reference/unityengine/uielements/gridline/span-1.md)         | The span count when [\_isSpan](/engine/6000.7/script-reference/unityengine/uielements/gridline/isspan.md) is true; otherwise 0.         |

## Static Properties

| Property                                                                        | Description                                          |
| ------------------------------------------------------------------------------- | ---------------------------------------------------- |
| [Auto](/engine/6000.7/script-reference/unityengine/uielements/gridline/auto.md) | `auto`: the edge is resolved by grid auto-placement. |

## Methods

| Method                                                                                  | Description                                                |
| --------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| [ToString](/engine/6000.7/script-reference/unityengine/uielements/gridline/tostring.md) | The USS text form: `auto`, `span <n>`, or the line number. |

## Static Methods

| Method                                                                              | Description                                      |
| ----------------------------------------------------------------------------------- | ------------------------------------------------ |
| [AtLine](/engine/6000.7/script-reference/unityengine/uielements/gridline/atline.md) | An explicit 1-based grid line.                   |
| [Span](/engine/6000.7/script-reference/unityengine/uielements/gridline/span.md)     | A span of `count` tracks from the opposite edge. |

## Operators

| Operator                                                                                   | Description                                                             |
| ------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- |
| [GridLine](/engine/6000.7/script-reference/unityengine/uielements/gridline/op-implicit.md) | Converts a positive integer to an explicit line; 0 and negatives throw. |
