Class RadzenFormField
A Blazor component that wraps another component and adds a label, helper text, start and end content.
Implements
Inherited Members
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public class RadzenFormField : RadzenComponent, IDisposable
Examples
<RadzenFormField Text="Search">
<RadzenTextBox @bind-Value="@text" />
</RadzenFormField>
Constructors
RadzenFormField()
Initializes a new instance of the RadzenFormField class.
Declaration
public RadzenFormField()
Properties
ChildContent
Gets or sets the child content. The child content is wrapped by the form field. Can be used with RadzenTextBox, RadzenTextArea, RadzenPassword, RadzenDropDown, RadzenDropDownList, RadzenNumeric.
Declaration
public RenderFragment ChildContent { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment |
Component
Gets or sets the name of the form field. Used to associate the label with a component.
Declaration
public string Component { get; set; }
Property Value
Type | Description |
---|---|
System.String |
End
Gets or sets the optional content that will be rendered after the child content. Usually used with RadzenIcon.
Declaration
public RenderFragment End { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment |
Examples
<RadzenFormField>
<End>
<RadzenIcon Icon="search" />
</End>
<ChildContent>
<RadzenTextBox @bind-Value="@text" />
</ChildContent>
</RadzenFormField>
Helper
Gets or sets the optional content that will be rendered below the child content. Used with a validator or to display some additional information.
Declaration
public RenderFragment Helper { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment |
Examples
<RadzenFormField>
<Helper>
<RadzenRequiredValidator Component="Text" />
</Helper>
<ChildContent>
. <RadzenTextBox @bind-Value="@text" Name="Text" />
</ChildContent>
</RadzenFormField>
Start
Gets or sets the optional content that will be rendered before the child content. Usually used with RadzenIcon.
Declaration
public RenderFragment Start { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment |
Examples
<RadzenFormField Text="Search">
<Start>
<RadzenIcon Icon="search" />
</Start>
<ChildContent>
<RadzenTextBox @bind-Value="@text" />
</ChildContent>
</RadzenFormField>
Text
Gets or sets the label text.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Variant
Gets or sets the design variant of the form field.
Declaration
public Variant Variant { get; set; }
Property Value
Type | Description |
---|---|
Variant | The variant of the form field. |
Methods
GetComponentCssClass()
Gets the component CSS class.
Declaration
protected override string GetComponentCssClass()
Returns
Type | Description |
---|---|
System.String |