ClassFormGroup
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:
public class FormGroup : ComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IFormItemsContainer, IFormGroup, IFormItemBase, IDisposable
Inheritance: objectComponentBaseFormGroup
Implements:
Inherited Members
Constructors
FormGroup()
Declaration
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
[Parameter]
public RenderFragment ChildContent { get; set; }
Property Value
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
[Parameter]
public string Class { get; set; }
Property Value
Implements
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
[Parameter]
public string ColumnSpacing { get; set; }
Property Value
Implements
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
[Parameter]
public int Columns { get; set; }
Property Value
Implements
FormItemsCollection
Declaration
public List<IFormItemBase> FormItemsCollection { get; }
Property Value
Implements
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.
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
[Parameter]
public string LabelText { get; set; }
Property Value
Implements
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
[Parameter]
public string RowSpacing { get; set; }
Property Value
Implements
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
Overrides
Dispose()
Declaration
public void Dispose()
Implements
OnInitialized()
Declaration
protected override void OnInitialized()
Overrides