# TableLayoutStyleCollection

Namespace: **Wisej.Web**

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

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

{% tabs %}
{% tab title="C#" %}

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

{% endtab %}

{% tab title="VB.NET" %}

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

{% endtab %}
{% endtabs %}

## Properties

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Count

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

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Item(index)

[TableLayoutStyle](https://docs.wisej.com/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutstyle): Returns or sets [TableLayoutStyle](https://docs.wisej.com/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

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Add(style)

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

| Parameter | Type                                                                                                            | Description                                                                                                                                                                                                                                                            |
| --------- | --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **style** | [TableLayoutStyle](https://docs.wisej.com/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutstyle) | The [TableLayoutStyle](https://docs.wisej.com/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutstyle) to add to the [TableLayoutStyleCollection](https://docs.wisej.com/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.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) Clear()

Disassociates the collection from its associated [TableLayoutPanel](https://docs.wisej.com/api/wisej.web/containers/tablelayoutpanel) and empties the collection.

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) 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](https://docs.wisej.com/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutstyle) to be removed. |

## Inherited By

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