YouTip LogoYouTip

Prop Webcontrol Radiobuttonlist Repeatdirection

## ASP.NET RadioButtonList RepeatDirection Property The `RepeatDirection` property is used to get or set the layout direction of the items within a `RadioButtonList` control. It determines whether the radio buttons are displayed horizontally or vertically. --- ## Definition and Usage By default, the items in a `RadioButtonList` are rendered vertically (one item per row). By using the `RepeatDirection` property, you can change this behavior to display the items horizontally (side-by-side in a single row), which is highly useful for optimizing screen space and improving form layouts. --- ## Syntax ```xml ``` ### Property Values | Value | Description | | :--- | :--- | | `Horizontal` | Displays the radio button items horizontally in rows. | | `Vertical` | **Default.** Displays the radio button items vertically in columns. | --- ## Code Examples ### Example 1: Horizontal Layout The following example demonstrates how to set the `RepeatDirection` of a `RadioButtonList` control to `Horizontal` so that the options appear side-by-side: ```xml
``` ### Example 2: Vertical Layout (Default) If you omit the `RepeatDirection` property, or explicitly set it to `Vertical`, the items will stack on top of each other: ```xml
``` --- ## Key Considerations * **Layout Control with RepeatLayout:** The visual rendering of `RepeatDirection` can be influenced by the `RepeatLayout` property. For example, if `RepeatLayout` is set to `Table` (the default), the control renders as an HTML ``. If set to `Flow`, it renders using inline elements like `` or `
` tags, which may affect how horizontal/vertical alignment behaves with custom CSS. * **Responsive Design:** When using `RepeatDirection="Horizontal"`, ensure that the container is wide enough to accommodate all list items on smaller screens to prevent unwanted text wrapping or layout breaking.
← Graph Theory IterUnion Find Rank β†’

YouTip © 2024-2026 | Home | Learn Technology, Build Dreams!

All content is for educational and learning purposes only.