# Columns

> Represents a collection of columns.

## Definition

* **Type:** Class
* **Namespace:** [UnityEngine.UIElements](/engine/6000.0/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule
* **Implements:** [ICollection\<Column>](https://learn.microsoft.com/dotnet/api/system.collections.generic.icollection-1), [IEnumerable\<Column>](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1), [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.ienumerable), [INotifyBindablePropertyChanged](/engine/6000.0/script-reference/unityengine/uielements/inotifybindablepropertychanged.md)

```csharp
[UxmlObject]
public class Columns : ICollection<Column>, IEnumerable<Column>, IEnumerable, INotifyBindablePropertyChanged
```

## Properties

| Property                                                                                                 | Description                                                                                                                                                                                                                                                                           |
| -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Count](/engine/6000.0/script-reference/unityengine/uielements/columns/count.md)                         | Gets the number of columns in the collection.                                                                                                                                                                                                                                         |
| [IsReadOnly](/engine/6000.0/script-reference/unityengine/uielements/columns/isreadonly.md)               | Gets a value indicating whether the collection is readonly.                                                                                                                                                                                                                           |
| [this\[\]](/engine/6000.0/script-reference/unityengine/uielements/columns/item.md)                       | Returns the column at the specified index.                                                                                                                                                                                                                                            |
| [primaryColumnName](/engine/6000.0/script-reference/unityengine/uielements/columns/primarycolumnname.md) | Indicates the column that needs to be considered as the primary column, by ID.                                                                                                                                                                                                        |
| [reorderable](/engine/6000.0/script-reference/unityengine/uielements/columns/reorderable.md)             | Indicates whether the columns can be reordered interactively by user.                                                                                                                                                                                                                 |
| [resizable](/engine/6000.0/script-reference/unityengine/uielements/columns/resizable.md)                 | Indicates whether the columns can be resized interactively by user.                                                                                                                                                                                                                   |
| [resizePreview](/engine/6000.0/script-reference/unityengine/uielements/columns/resizepreview.md)         | Indicates whether columns are resized as the user drags resize handles or only upon mouse release.                                                                                                                                                                                    |
| [stretchMode](/engine/6000.0/script-reference/unityengine/uielements/columns/stretchmode-1.md)           | Indicates how the size of columns in this collection is automatically adjusted as other columns or the containing view get resized. The default value is [Columns.StretchMode.GrowAndFill](/engine/6000.0/script-reference/unityengine/uielements/columns/stretchmode/growandfill.md) |

## Methods

| Method                                                                                             | Description                                                                                           |
| -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| [Add](/engine/6000.0/script-reference/unityengine/uielements/columns/add.md)                       | Adds a column at the end of the collection.                                                           |
| [Clear](/engine/6000.0/script-reference/unityengine/uielements/columns/clear.md)                   | Removes all columns from the collection.                                                              |
| [Contains](/engine/6000.0/script-reference/unityengine/uielements/columns/contains.md)             | Whether the columns contain the specified name.                                                       |
| [CopyTo](/engine/6000.0/script-reference/unityengine/uielements/columns/copyto.md)                 | Copies the elements of the current collection to a Array, starting at the specified index.            |
| [GetEnumerator](/engine/6000.0/script-reference/unityengine/uielements/columns/getenumerator.md)   | Returns an enumerator that iterates through the collection.                                           |
| [IndexOf](/engine/6000.0/script-reference/unityengine/uielements/columns/indexof.md)               | Returns the index of the specified column if it is contained in the collection; returns -1 otherwise. |
| [Insert](/engine/6000.0/script-reference/unityengine/uielements/columns/insert.md)                 | Inserts a column into the current instance at the specified index.                                    |
| [IsPrimary](/engine/6000.0/script-reference/unityengine/uielements/columns/isprimary.md)           | Checks if the specified column is the primary one.                                                    |
| [Remove](/engine/6000.0/script-reference/unityengine/uielements/columns/remove.md)                 | Removes the first occurence of a column from the collection.                                          |
| [RemoveAt](/engine/6000.0/script-reference/unityengine/uielements/columns/removeat.md)             | Removes the column at the specified index.                                                            |
| [ReorderDisplay](/engine/6000.0/script-reference/unityengine/uielements/columns/reorderdisplay.md) | Reorders the display of a column at the specified source index, to the destination index.             |

## Events

| Member                                                                                               | Description                         |
| ---------------------------------------------------------------------------------------------------- | ----------------------------------- |
| [propertyChanged](/engine/6000.0/script-reference/unityengine/uielements/columns/propertychanged.md) | Called when a property has changed. |

## Enums

| Enum                                                                                                 | Description                                                                                                                                                                                                                                                                                   |
| ---------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Columns.StretchMode](/engine/6000.0/script-reference/unityengine/uielements/columns/stretchmode.md) | Indicates how the size of a stretchable column in this collection should get automatically adjusted as other columns or its containing view get resized. The default value is [Columns.StretchMode.Grow](/engine/6000.0/script-reference/unityengine/uielements/columns/stretchmode/grow.md). |
