Prop Webcontrol Checkboxlist Repeatdirection
## ASP.NET CheckBoxList RepeatDirection Property
The `RepeatDirection` property is a key layout feature of the ASP.NET Web Server `CheckBoxList` control. It allows developers to control whether the checkbox items within the list are rendered horizontally or vertically.
---
## Definition and Usage
The `RepeatDirection` property gets or sets the direction in which the checkbox items in a `CheckBoxList` control are displayed.
By default, the items are stacked vertically. However, you can change this property to display them side-by-side horizontally, which is highly useful for optimizing screen space and improving form layouts.
---
## Syntax
```xml
```
### Property Values
| Value | Description |
| :--- | :--- |
| **`Horizontal`** | Displays the checkbox items in rows from left to right. |
| **`Vertical`** | (Default) Displays the checkbox items in columns from top to bottom. |
---
## Code Examples
### Example 1: Horizontal Layout
The following example demonstrates how to set the `RepeatDirection` property to `Horizontal` to display checkbox items side-by-side.
```xml
<%@ Page Language="C#" %>
CheckBoxList RepeatDirection Example
```
### Example 2: Vertical Layout (Default)
If you omit the `RepeatDirection` property or set it to `Vertical`, the items will stack vertically.
```xml
```
---
## Key Considerations
1. **Interaction with `RepeatLayout`**:
The visual output of `RepeatDirection` can be influenced by the `RepeatLayout` property (which determines whether the list is rendered using an HTML ``, `
YouTip