# TableLayoutPanel

Namespace: **Wisej.Web**

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

* [Control](https://docs.wisej.com/api/wisej.web/general/control)
  * [ScrollableControl](https://docs.wisej.com/api/wisej.web/containers/scrollablecontrol)
    * [Panel](https://docs.wisej.com/api/wisej.web/containers/wisej.web.panel)
      * [TableLayoutPanel](https://docs.wisej.com/api/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://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) TableLayoutPanel()

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

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

Initializes a new instance of the [TableLayoutPanel](https://docs.wisej.com/api/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/wisej.web/general/control) | The array of child controls to add to the panel. |

## 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) ColumnCount

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

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

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

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

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

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

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

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

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

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

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

## 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) GetCellPosition(control)

Returns the [TableLayoutPanelCellPosition](https://docs.wisej.com/api/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/wisej.web/general/control) | A control contained within a cell. |

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

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%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/wisej.web/general/control) | A child control of the [TableLayoutPanel](https://docs.wisej.com/api/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/v4.0/wisej.web.layout/containers/layoutengine/layoutengine/README.md).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%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/wisej.web/general/control) | A child control of the [TableLayoutPanel](https://docs.wisej.com/api/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://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%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/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/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://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-2389c55cd19719a73a5ae98e1528c8dc8525cc35%2Finstance.png?alt=media) GetPositionFromControl(control)

Returns the [TableLayoutPanelCellPosition](https://docs.wisej.com/api/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/wisej.web/general/control) | A control contained within a cell. |

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

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%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/wisej.web/general/control) | A child control of the [TableLayoutPanel](https://docs.wisej.com/api/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/v4.0/wisej.web.layout/containers/layoutengine/layoutengine/README.md).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%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/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/wisej.web/containers/tablelayoutpanel).

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%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/wisej.web/general/control) | A child control of the [TableLayoutPanel](https://docs.wisej.com/api/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://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%2Fuploads%2Fgit-blob-9bf7fa01e02f4da0f9ef90d3b049ae43e664919e%2Fprotected.png?alt=media) ScaleControl(factor, specified)

Scales a control's location, size, padding and margin.

| Parameter     | Type                                                                                           | Description                                                                                                                                                                                 |
| ------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **factor**    | [SizeF](https://docs.microsoft.com/dotnet/api/system.drawing.sizef)                            | The factor by which the height and width of the control will be scaled.                                                                                                                     |
| **specified** | [BoundsSpecified](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.boundsspecified) | A [BoundsSpecified](https://docs.wisej.com/api/wisej.web/enumerations/wisej.web.boundsspecified) value that specifies the bounds of the control to use when defining its size and position. |

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

Sets the [TableLayoutPanelCellPosition](https://docs.wisej.com/api/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/wisej.web/general/control)                                                                         | A control contained within a cell.                                                                                                                                                            |
| **position** | [TableLayoutPanelCellPosition](https://docs.wisej.com/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutpanelcellposition) | A [TableLayoutPanelCellPosition](https://docs.wisej.com/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutpanelcellposition) that represents the row and the column of the cell. |

### ![](https://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%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/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://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%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/wisej.web/general/control) | A child control of the [TableLayoutPanel](https://docs.wisej.com/api/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://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%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/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://1075938901-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2HvlWXJQMV7DxhGzw7Y1%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/wisej.web/general/control) | A child control of the [TableLayoutPanel](https://docs.wisej.com/api/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                                                                                                                              |
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [IUserData](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.iuserdata)                     | Provides access to the `UserData` and `Tag` properties associated to the component implementing this interface.                          |
| [IBindableComponent](https://docs.wisej.com/api/wisej.web/data-binding/wisej.web.ibindablecomponent) | Bindable components implement this interface.                                                                                            |
| [IDropTarget](https://docs.wisej.com/api/wisej.web/interfaces/wisej.web.idroptarget)                 | Controls that support drag & drop operations implement this interface.                                                                   |
| [IImage](https://docs.wisej.com/api/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/wisej.core/interfaces/wisej.core.iwisejcomponent)       | All wisej components implement this interface.                                                                                           |
| [IWisejControl](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejcontrol)           | All wisej controls derived from the [Control](https://docs.wisej.com/api/wisej.web/general/control) class must implement this interface. |
| [IWisejSerializable](https://docs.wisej.com/api/wisej.core/interfaces/wisej.core.iwisejserializable) | Allows an object to serialize itself.                                                                                                    |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/api/wisej.web/containers/tablelayoutpanel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
