# TableLayoutPanelExtensions

Namespace: **Wisej.Web.Markup**

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

Adds [fluent markup](https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/markup/markup) extension methods to the [TableLayoutPanel](/api/wisej.web/containers/tablelayoutpanel.md) class.

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

```csharp
public class TableLayoutPanelExtensions
```

{% endtab %}

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

```visual-basic
Public Class TableLayoutPanelExtensions
```

{% endtab %}
{% endtabs %}

## Methods

### ![](/files/lIX317sDtMTZJBi9oSIx) ColumnCount\<TPanel>(panel, value)

Sets the number of columns in the [TableLayoutPanel](/api/wisej.web/containers/tablelayoutpanel.md).

| Parameter  | Type                                                                                      | Description                                                                                                       |
| ---------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **TPanel** |                                                                                           | The type of the panel, which must inherit from [TableLayoutPanel](/api/wisej.web/containers/tablelayoutpanel.md). |
| **panel**  | [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.tablelayoutpanelextensions.md) | The panel on which to set the column count.                                                                       |
| **value**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                               | The number of columns to set.                                                                                     |

**Returns:** [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.tablelayoutpanelextensions.md). The modified panel with the updated column count.

### ![](/files/lIX317sDtMTZJBi9oSIx) GrowStyle\<TPanel>(panel, value)

Sets the grow style for the [TableLayoutPanel](/api/wisej.web/containers/tablelayoutpanel.md).

| Parameter  | Type                                                                                                           | Description                                                                                                                               |
| ---------- | -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **TPanel** |                                                                                                                | The type of the panel, which must inherit from [TableLayoutPanel](/api/wisej.web/containers/tablelayoutpanel.md).                         |
| **panel**  | [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.tablelayoutpanelextensions.md)                      | The panel on which to set the grow style.                                                                                                 |
| **value**  | [TableLayoutPanelGrowStyle](/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutpanelgrowstyle.md) | The [TableLayoutPanelGrowStyle](/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutpanelgrowstyle.md) to apply to the panel. |

**Returns:** [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.tablelayoutpanelextensions.md). The modified panel with the updated grow style.

### ![](/files/lIX317sDtMTZJBi9oSIx) LayoutSettings\<TPanel>(panel, settings)

Sets the LayoutSettings property of the specified [TableLayoutPanel](/api/wisej.web/containers/tablelayoutpanel.md).

| Parameter    | Type                                                                                               | Description                                                                                                                   |
| ------------ | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| **TPanel**   |                                                                                                    | The type of the panel, must inherit from [TableLayoutPanel](/api/wisej.web/containers/tablelayoutpanel.md).                   |
| **panel**    | [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.tablelayoutpanelextensions.md)          | The panel for which to set the LayoutSettings property.                                                                       |
| **settings** | [TableLayoutSettings](/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutsettings.md) | The [TableLayoutSettings](/api/wisej.web/containers/tablelayoutpanel/wisej.web.tablelayoutsettings.md) to apply to the panel. |

**Returns:** [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.tablelayoutpanelextensions.md). The modified panel with the updated LayoutSettings property.

This method allows you to configure the layout settings, such as row and column styles, for a table layout panel in a fluent interface style.

```csharp

var settings = new TableLayoutSettings
{
// Configure settings here
};
myTableLayoutPanel.LayoutSettings(settings);

```

### ![](/files/lIX317sDtMTZJBi9oSIx) RowCount\<TPanel>(panel, value)

Sets the number of rows in the [TableLayoutPanel](/api/wisej.web/containers/tablelayoutpanel.md).

| Parameter  | Type                                                                                      | Description                                                                                                       |
| ---------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| **TPanel** |                                                                                           | The type of the panel, which must inherit from [TableLayoutPanel](/api/wisej.web/containers/tablelayoutpanel.md). |
| **panel**  | [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.tablelayoutpanelextensions.md) | The panel on which to set the row count.                                                                          |
| **value**  | [Int32](https://docs.microsoft.com/dotnet/api/system.int32)                               | The number of rows to set.                                                                                        |

**Returns:** [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.tablelayoutpanelextensions.md). The modified panel with the updated row count.

### ![](/files/lIX317sDtMTZJBi9oSIx) RowCount\<TPanel>(panel, styles)

Sets the column styles for the [TableLayoutPanel](/api/wisej.web/containers/tablelayoutpanel.md).

| Parameter  | Type                                                                                      | Description                                                                                                                   |
| ---------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| **TPanel** |                                                                                           | The type of the panel, which must inherit from [TableLayoutPanel](/api/wisej.web/containers/tablelayoutpanel.md).             |
| **panel**  | [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.tablelayoutpanelextensions.md) | The panel on which to set the column styles.                                                                                  |
| **styles** | [ColumnStyle\[\]](/api/wisej.web/containers/tablelayoutpanel/wisej.web.columnstyle.md)    | An array of [ColumnStyle](/api/wisej.web/containers/tablelayoutpanel/wisej.web.columnstyle.md) objects to apply to the panel. |

**Returns:** [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.tablelayoutpanelextensions.md). The modified panel with the updated column styles.

This method clears any existing column styles before applying the new styles.

```csharp

var panel = new TableLayoutPanel();
panel.ColumnStyles(new ColumnStyle(SizeType.AutoSize), new ColumnStyle(SizeType.Percent, 50));

```

### ![](/files/lIX317sDtMTZJBi9oSIx) RowStyles\<TPanel>(panel, styles)

Sets the row styles for the [TableLayoutPanel](/api/wisej.web/containers/tablelayoutpanel.md).

| Parameter  | Type                                                                                      | Description                                                                                                             |
| ---------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **TPanel** |                                                                                           | The type of the panel, which must inherit from [TableLayoutPanel](/api/wisej.web/containers/tablelayoutpanel.md).       |
| **panel**  | [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.tablelayoutpanelextensions.md) | The panel on which to set the row styles.                                                                               |
| **styles** | [RowStyle\[\]](/api/wisej.web/containers/tablelayoutpanel/wisej.web.rowstyle.md)          | An array of [RowStyle](/api/wisej.web/containers/tablelayoutpanel/wisej.web.rowstyle.md) objects to apply to the panel. |

**Returns:** [TPanel](/api/wisej.web.markup/extensions/wisej.web.markup.tablelayoutpanelextensions.md). The modified panel with the updated row styles.

This method clears any existing row styles before applying the new styles.

```csharp

var panel = new TableLayoutPanel();
panel.RowStyles(new RowStyle(SizeType.AutoSize), new RowStyle(SizeType.Percent, 50));

```


---

# 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.markup/extensions/wisej.web.markup.tablelayoutpanelextensions.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.
