Class RadzenFormField
A Blazor component that wraps another component and adds a label, helper text, start and end content.
public class RadzenFormField : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
- Inheritance
-
RadzenFormField
- Implements
- Inherited Members
Examples
<RadzenFormField Text="Search">
<RadzenTextBox @bind-Value="@text" />
</RadzenFormField>
Constructors
RadzenFormField()
Initializes a new instance of the RadzenFormField class.
public RadzenFormField()
Properties
AllowFloatingLabel
Gets or sets a value indicating whether the label is floating or fixed on top.
[Parameter]
public bool AllowFloatingLabel { get; set; }
Property Value
- bool
true
if floating is allowed; otherwise,false
.
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.
[Parameter]
public RenderFragment ChildContent { get; set; }
Property Value
Component
Gets or sets the name of the form field. Used to associate the label with a component.
[Parameter]
public string Component { get; set; }
Property Value
End
Gets or sets the optional content that will be rendered after the child content. Usually used with RadzenIcon.
[Parameter]
public RenderFragment End { get; set; }
Property Value
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.
[Parameter]
public RenderFragment Helper { get; set; }
Property Value
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.
[Parameter]
public RenderFragment Start { get; set; }
Property Value
Examples
<RadzenFormField Text="Search">
<Start>
<RadzenIcon Icon="search" />
</Start>
<ChildContent>
<RadzenTextBox @bind-Value="@text" />
</ChildContent>
</RadzenFormField>
Text
Gets or sets the label text.
[Parameter]
public string Text { get; set; }
Property Value
Variant
Gets or sets the design variant of the form field.
[Parameter]
public Variant Variant { get; set; }
Property Value
- Variant
The variant of the form field.
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
GetComponentCssClass()
protected override string GetComponentCssClass()
Returns
OnParametersSet()
protected override void OnParametersSet()