# TableLayoutPanel

Namespace: **Wisej.Web**

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

* [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control)
  * [ScrollableControl](https://docs.wisej.com/api/v3.5/wisej.web/containers/scrollablecontrol)
    * [Panel](https://docs.wisej.com/api/v3.5/wisej.web/containers/wisej.web.panel)
      * [TableLayoutPanel](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel)

Represents a panel that dynamically lays out its contents in a grid composed of rows and columns.

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

```csharp
public class TableLayoutPanel : Panel, IExtenderProvider
```

{% endtab %}

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

```visual-basic
Public Class TableLayoutPanel
    Inherits Panel
    Implements IExtenderProvider
```

{% endtab %}
{% endtabs %}

## Constructors

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

Initializes a new instance of the [TableLayoutPanel](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel) class.

### ![](https://2194374196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVxzkjZGSCpOtYHlmOePS%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media)TableLayoutPanel(location, size, controls)

Initializes a new instance of the [TableLayoutPanel](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel) class with the specified initial settings.

| Name         | Type                                                                     | Description                                      |
| ------------ | ------------------------------------------------------------------------ | ------------------------------------------------ |
| **location** | [Point](https://docs.microsoft.com/dotnet/api/system.drawing.point)      | The location of the panel on its parent control. |
| **size**     | [Size](https://docs.microsoft.com/dotnet/api/system.drawing.size)        | The size of the panel.                           |
| **controls** | [Control\[\]](https://docs.wisej.com/api/v3.5/wisej.web/general/control) | The array of child controls to add to the panel. |

## Properties

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

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the number of columns in the table. (Default: `0`)

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

[TableLayoutColumnStyleCollection](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutcolumnstylecollection): Returns a collection of column styles for the [TableLayoutPanel](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel).

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

[TableLayoutControlCollection](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutcontrolcollection): Returns the collection of controls contained within the [TableLayoutPanel](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel).

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

[TableLayoutPanelGrowStyle](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutpanelgrowstyle): Returns or sets whether the [TableLayoutPanel](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel) control should expand to accommodate new cells when all existing cells are occupied. (Default: `AddRows`)

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

[LayoutEngine](https://github.com/iceteagroup/wisej-docs-api/blob/v3.5/wisej.web.layout/containers/layoutengine/layoutengine/README.md): Returns the control's layout engine.

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

[Int32](https://docs.microsoft.com/dotnet/api/system.int32): Returns or sets the number of rows in the table. (Default: `0`)

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

[TableLayoutRowStyleCollection](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutrowstylecollection): Returns a collection of row styles for the [TableLayoutPanel](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel).

## Methods

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

Returns the [TableLayoutPanelCellPosition](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutpanelcellposition) that represents the row and the column of the cell.

| Parameter   | Type                                                                 | Description                        |
| ----------- | -------------------------------------------------------------------- | ---------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control) | A control contained within a cell. |

**Returns:** [TableLayoutPanelCellPosition](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutpanelcellposition). A [TableLayoutPanelCellPosition](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutpanelcellposition) that represents the cell position.

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

Returns the column position of the specified child control.

| Parameter   | Type                                                                 | Description                                                                                                       |
| ----------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control) | A child control of the [TableLayoutPanel](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel). |

**Returns:** [Int32](https://docs.microsoft.com/dotnet/api/system.int32). The column position of the specified child control, or -1 if the position of *control* is determined by [LayoutEngine](#layoutengine).

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *control* is null.
* [NotSupportedException](https://docs.microsoft.com/dotnet/api/system.notsupportedexception) *control* is not a type that can be arranged by this [LayoutEngine](https://github.com/iceteagroup/wisej-docs-api/blob/v3.5/wisej.web.layout/containers/layoutengine/layoutengine/README.md).

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

Returns the number of columns spanned by the specified child control.

| Parameter   | Type                                                                 | Description                                                                                                       |
| ----------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control) | A child control of the [TableLayoutPanel](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel). |

**Returns:** [Int32](https://docs.microsoft.com/dotnet/api/system.int32). The number of columns spanned by the child control. The default is 1.

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

Returns the child control occupying the specified position.

| Parameter  | Type                                                        | Description                                     |
| ---------- | ----------------------------------------------------------- | ----------------------------------------------- |
| **column** | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The column position of the control to retrieve. |
| **row**    | [Int32](https://docs.microsoft.com/dotnet/api/system.int32) | The row position of the control to retrieve.    |

**Returns:** [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control). The child control occupying the specified cell; otherwise, null if no control exists at the specified column and row, or if the control has its [Visible](https://docs.wisej.com/api/v3.5/general/control#visible) property set to false.

**Throws:**

* [ArgumentException](https://docs.microsoft.com/dotnet/api/system.argumentexception) Either *column* or *row* (or both) is less than 0.

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

Returns the [TableLayoutPanelCellPosition](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutpanelcellposition) that represents the row and the column of the cell that contains the control.

| Parameter   | Type                                                                 | Description                        |
| ----------- | -------------------------------------------------------------------- | ---------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control) | A control contained within a cell. |

**Returns:** [TableLayoutPanelCellPosition](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutpanelcellposition). A [TableLayoutPanelCellPosition](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutpanelcellposition) that represents the cell position.

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

Returns the row position of the specified child control.

| Parameter   | Type                                                                 | Description                                                                                                       |
| ----------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control) | A child control of the [TableLayoutPanel](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel). |

**Returns:** [Int32](https://docs.microsoft.com/dotnet/api/system.int32). The row position of *control* , or -1 if the position of *control* is determined by [LayoutEngine](#layoutengine).

**Throws:**

* [ArgumentNullException](https://docs.microsoft.com/dotnet/api/system.argumentnullexception) *control* is null.
* [NotSupportedException](https://docs.microsoft.com/dotnet/api/system.notsupportedexception) *control* is not a type that can be arranged by this [LayoutEngine](https://github.com/iceteagroup/wisej-docs-api/blob/v3.5/wisej.web.layout/containers/layoutengine/layoutengine/README.md).

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

Returns an array representing the heights, in pixels, of the rows in the [TableLayoutPanel](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel).

**Returns:** [Int32\[\]](https://docs.microsoft.com/dotnet/api/system.int32). An array of type [Int32](https://docs.microsoft.com/dotnet/api/system.int32) that contains the heights, in pixels, of the rows in the [TableLayoutPanel](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel).

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

Returns the number of rows spanned by the specified child control.

| Parameter   | Type                                                                 | Description                                                                                                       |
| ----------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control) | A child control of the [TableLayoutPanel](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel). |

**Returns:** [Int32](https://docs.microsoft.com/dotnet/api/system.int32). The number of rows spanned by the child control. The default is 1.

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

Sets the [TableLayoutPanelCellPosition](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutpanelcellposition) that represents the row and the column of the cell.

| Parameter    | Type                                                                                                                                         | Description                                                                                                                                                                                        |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **control**  | [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control)                                                                         | A control contained within a cell.                                                                                                                                                                 |
| **position** | [TableLayoutPanelCellPosition](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutpanelcellposition) | A [TableLayoutPanelCellPosition](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutpanelcellposition) that represents the row and the column of the cell. |

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

Sets the column position of the specified child control.

| Parameter   | Type                                                                 | Description                                  |
| ----------- | -------------------------------------------------------------------- | -------------------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control) | The control to move to another column.       |
| **column**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)          | The column to which *control* will be moved. |

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

Sets the number of columns spanned by the child control.

| Parameter   | Type                                                                 | Description                                                                                                       |
| ----------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control) | A child control of the [TableLayoutPanel](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel). |
| **value**   | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)          | The number of columns to span.                                                                                    |

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) *value* is less than 1.

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

Sets the row position of the specified child control.

| Parameter   | Type                                                                 | Description                               |
| ----------- | -------------------------------------------------------------------- | ----------------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control) | The control to move to another row.       |
| **row**     | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)          | The row to which *control* will be moved. |

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

Sets the number of rows spanned by the child control.

| Parameter   | Type                                                                 | Description                                                                                                       |
| ----------- | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **control** | [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control) | A child control of the [TableLayoutPanel](https://docs.wisej.com/api/v3.5/wisej.web/containers/tablelayoutpanel). |
| **value**   | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)          | The number of rows to span.                                                                                       |

**Throws:**

* [ArgumentOutOfRangeException](https://docs.microsoft.com/dotnet/api/system.argumentoutofrangeexception) *value* is less than 1.

## Implements

| Name                                                                                                      | Description                                                                                                                                   |
| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| [IBindableComponent](https://docs.wisej.com/api/v3.5/wisej.web/data-binding/wisej.web.ibindablecomponent) | Bindable components implement this interface.                                                                                                 |
| [IDropTarget](https://docs.wisej.com/api/v3.5/wisej.web/interfaces/wisej.web.idroptarget)                 | Controls that support drag & drop operations implement this interface.                                                                        |
| [IImage](https://docs.wisej.com/api/v3.5/wisej.web/interfaces/wisej.web.iimage)                           | Provides access to common image properties across the controls that implement this interface.                                                 |
| [IWisejComponent](https://docs.wisej.com/api/v3.5/wisej.core/interfaces/wisej.core.iwisejcomponent)       | All wisej components implement this interface.                                                                                                |
| [IWisejControl](https://docs.wisej.com/api/v3.5/wisej.core/interfaces/wisej.core.iwisejcontrol)           | All wisej controls derived from the [Control](https://docs.wisej.com/api/v3.5/wisej.web/general/control) class must implement this interface. |
| [IWisejSerializable](https://docs.wisej.com/api/v3.5/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.                                                                                                         |
