Class
FormGroup

Organizes related form fields into logical sections with optional labeling and independent layout configuration. Enables hierarchical form organization by grouping related fields together and supports nested groups for complex form structures. Use this component to create form sections like "Personal Information", "Contact Details", or "Preferences" with their own grid layouts and styling. Provides independent column configuration, spacing control, and custom CSS classes for flexible form section design.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

cs-api-definition
public class FormGroup : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IFormItemsContainer, IFormGroup, IFormItemBase, IDisposable

Inheritance: objectComponentBaseFormGroup

Implements: IComponentIDisposableIFormGroupIFormItemBaseIFormItemsContainerIHandleAfterRenderIHandleEvent

Inherited Members ComponentBase.OnInitializedAsync()ComponentBase.OnParametersSet()ComponentBase.OnParametersSetAsync()ComponentBase.StateHasChanged()ComponentBase.ShouldRender()ComponentBase.OnAfterRender(bool)ComponentBase.OnAfterRenderAsync(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)ComponentBase.SetParametersAsync(ParameterView)

Constructors

FormGroup()

Declaration

cs-api-definition
public FormGroup()

Properties

ChildContent

Contains the form items that belong to this logical group, enabling organized form sections and nested layouts. Use this to group related fields together, such as "Personal Information", "Contact Details", or "Preferences" sections. Groups can contain FormItem components for individual fields and nested FormGroup components for hierarchical organization. The grouped items inherit the group's layout settings including column configuration and spacing when grid layout is enabled. Children: FormItem tags.

Declaration

cs-api-definition
[Parameter]
public RenderFragment ChildContent { get; set; }

Property Value

RenderFragment

Class

Adds custom CSS classes to the form group container for specialized styling, theming, or layout adjustments. Use this to apply group-specific styling, responsive behaviors, or integration with CSS frameworks like Bootstrap or Tailwind. Classes are applied to the group's wrapper element, affecting the group label, layout container, and all contained form items. Multiple classes can be specified using space-separated values such as "important-section highlighted-group". Ideal for creating visual distinctions between form sections or implementing conditional group styling.

Declaration

cs-api-definition
[Parameter]
public string Class { get; set; }

Property Value

string

Implements IFormGroup.Class

ColumnSpacing

Controls the horizontal spacing between columns when the form group uses multi-column grid layout. Accepts any valid CSS length value such as "8px", "1rem", "2em", or "1%" to define the gap between columns. Only takes effect when Columns is set to a value greater than 1 to enable grid layout within the group. Use smaller values like "8px" for compact layouts or larger values like "32px" for more spacious designs. Default value of "16px" provides balanced spacing suitable for most form group layouts.

Declaration

cs-api-definition
[Parameter]
public string ColumnSpacing { get; set; }

Property Value

string

Implements IFormGroup.ColumnSpacing

Columns

Specifies the number of columns for CSS Grid layout within this form group, independent of the parent form's column settings. When set to a value greater than 0, the group's form fields automatically arrange in a grid with the specified number of columns. Use values like 2 for side-by-side fields, 3 for three-column layouts, or higher numbers for dense information display. Set to 0 (default) to use single-column stacked layout or inherit column behavior from the parent form. Works together with ColumnSpacing and RowSpacing to create well-spaced group layouts.

Declaration

cs-api-definition
[Parameter]
public int Columns { get; set; }

Property Value

int

Implements IFormGroup.Columns

FormItemsCollection

Declaration

cs-api-definition
public List<IFormItemBase> FormItemsCollection { get; }

Property Value

List<IFormItemBase>

Implements IFormGroup.FormItemsCollection

Id

Assigns a unique identifier to the form group for programmatic access, testing, and accessibility purposes. The ID is automatically generated as a GUID when not specified, ensuring uniqueness within the form structure. Use custom IDs when you need to reference the group programmatically, implement custom navigation, or target specific groups in testing scenarios. This identifier is used internally for form organization and can be helpful for advanced form manipulation and debugging.

Declaration

cs-api-definition
[Parameter]
public string Id { get; set; }

Property Value

string

LabelText

Specifies the heading or title text that appears above the grouped form fields to identify the group's purpose. Use descriptive labels like "Personal Information", "Billing Address", or "Account Settings" to help users understand field relationships. The label text is rendered as a heading element, providing semantic structure and improving form accessibility for screen readers. Leave empty when grouping is purely for layout purposes without needing a visible section header.

Declaration

cs-api-definition
[Parameter]
public string LabelText { get; set; }

Property Value

string

Implements IFormGroup.LabelText

RowSpacing

Controls the vertical spacing between rows when the form group uses multi-column grid layout. Accepts any valid CSS length value such as "8px", "1rem", "2em", or "1%" to define the gap between rows. Only takes effect when Columns is set to a value greater than 1 to enable grid layout within the group. Use this to fine-tune the vertical rhythm and visual density of fields within the group. When not specified, the browser applies default grid row spacing based on the layout context.

Declaration

cs-api-definition
[Parameter]
public string RowSpacing { get; set; }

Property Value

string

Implements IFormGroup.RowSpacing

Methods

BuildRenderTree(RenderTreeBuilder)

Declaration

cs-api-definition
protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

Dispose()

Declaration

cs-api-definition
public void Dispose()

Implements IDisposable.Dispose()

OnInitialized()

Declaration

cs-api-definition
protected override void OnInitialized()

Overrides ComponentBase.OnInitialized()