# TableLayoutStyleCollection

URL: https://docs.wisej.com/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutstylecollection

Version: 4.1
Namespace: **Wisej.Web**

Assembly: **Wisej.Framework** (4.1.0.0)

Implements the basic functionality for a collection of table layout styles.

- C# - VB.NET

```csharp
public class TableLayoutStyleCollection : IList, ICollection, IEnumerable
```

```visual
Public Class TableLayoutStyleCollection
    Inherits IList
    Implements ICollection, IEnumerable
```

## Properties

### ![Instance member](/img/api/instance.png) Count

[Int32](https://docs.microsoft.com/dotnet/api/system.int32) : Gets the number of styles actually contained in the [TableLayoutStyleCollection](/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutstylecollection) .

### ![Instance member](/img/api/instance.png) Item(index)

[TableLayoutStyle](/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutstyle) : Returns or sets [TableLayoutStyle](/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutstyle) at the specified index.

**Throws:**

- [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) The property value is already assigned to another owner. You must first remove it from its current location or clone it.

## Methods

### ![Instance member](/img/api/instance.png) Add(style)

Adds a new [TableLayoutStyle](/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutstyle) to the end of the current collection.

| Parameter | Type | Description | **style** | [TableLayoutStyle](/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutstyle) | The [TableLayoutStyle](/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutstyle) to add to the [TableLayoutStyleCollection](/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutstylecollection) . 

**Returns:**[Int32](https://docs.microsoft.com/dotnet/api/system.int32) . The position into which the new element was inserted.

**Throws:**

- [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception)*style* is already assigned to another owner. You must first remove it from its current location or clone it.

### ![Instance member](/img/api/instance.png) Clear()

Disassociates the collection from its associatedTableLayoutPanel and empties the collection.

### ![Instance member](/img/api/instance.png) RemoveAt(index)

Removes the style at the specified index of the collection.

| Parameter | Type | Description | **index** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The zero-based index of the [TableLayoutStyle](/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutstyle) to be removed. 

## Inherited By

| Name | Description | [TableLayoutColumnStyleCollection](/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutcolumnstylecollection) | A collection that stores [ColumnStyle](/api/wisej.web/containers/tablelayoutpanel/wisej.web.columnstyle) objects. | [TableLayoutRowStyleCollection](/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutrowstylecollection) | A collection that stores [RowStyle](/api/wisej.web/containers/tablelayoutpanel/wisej.web.rowstyle) objects.
