Class
TelerikForm

The class for the Telerik Form Component.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

cs-api-definition
public class TelerikForm : BaseComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IFormItemsContainer

Inheritance: objectComponentBaseBaseComponentTelerikForm

Implements: IComponentIDisposableIFormItemsContainerIHandleAfterRenderIHandleEvent

Inherited Members BaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.OnAfterRenderAsync(bool)BaseComponent.Dispose()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnInitialized()ComponentBase.OnParametersSetAsync()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)

Constructors

TelerikForm()

Declaration

cs-api-definition
public TelerikForm()

Properties

AutoComplete

Defines the autocomplete attribute of the form.

Declaration

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

Property Value

string

ButtonsLayout

Defines the different buttons layout for horizontal alignment. Default value is End for horizontal, and Start for vertical.

Declaration

cs-api-definition
[Parameter]
public FormButtonsLayout? ButtonsLayout { get; set; }

Property Value

FormButtonsLayout?

ColumnSpacing

Defines the spacing between columns in form grid layout.

Declaration

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

Property Value

string

Columns

Defines the count of columns in form grid layout.

Declaration

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

Property Value

int

EditContext

Defines the EditContext of the form. The user should specify either EditContext, or Model.

Declaration

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

Property Value

EditContext

FormButtons

Defines the template for the form buttons. By default, the form renders a Submit button.

Declaration

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

Property Value

RenderFragment

FormItems

Defines the form items.

Declaration

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

Property Value

RenderFragment

FormItemsTemplate

Defines the form items template. In this tempalte you can use TelerikFormItemRenderer and TelerikFormGroupRenderer tags and customize the form layout. The context of the template is a FormItemsTemplateContext which contains a list of IFormItemBase items. The items can be of type IFormItem or IFormGroup and they persist the same structure and order as they are defined in FormItems RenderFragment parameter.

Declaration

cs-api-definition
[Parameter]
public RenderFragment<FormItemsTemplateContext> FormItemsTemplate { get; set; }

Property Value

RenderFragment<FormItemsTemplateContext>

FormValidation

Defines the form validation. Should be used for declaring validator, validation summary. Renders before the FormItems and FormButtons.

Declaration

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

Property Value

RenderFragment

Id

Defines the id attribute of the form.

Declaration

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

Property Value

string

Model

Defines the model of the form. If no FormItems are added, it will automatically generate fields for the user. The user should specify either Model, or EditContext.

Declaration

cs-api-definition
[Parameter]
public object Model { get; set; }

Property Value

object

OnInvalidSubmit

Fires when the form is submitted with invalid EditContext.

Declaration

cs-api-definition
[Parameter]
public EventCallback<EditContext> OnInvalidSubmit { get; set; }

Property Value

EventCallback<EditContext>

OnSubmit

Fires when the form is submitted. Use this event for manually triggering validation. Cannot be used together with OnValidSubmit and OnInvalidSubmit.

Declaration

cs-api-definition
[Parameter]
public EventCallback<EditContext> OnSubmit { get; set; }

Property Value

EventCallback<EditContext>

OnUpdate

Event triggered upon editing a field in the Telerik Form. The changed field name and newly updated model are available through the FormUpdateEventArgs event context.

Declaration

cs-api-definition
[Parameter]
public EventCallback<FormUpdateEventArgs> OnUpdate { get; set; }

Property Value

EventCallback<FormUpdateEventArgs>

OnValidSubmit

Fires when the form is submitted with valid EditContext.

Declaration

cs-api-definition
[Parameter]
public EventCallback<EditContext> OnValidSubmit { get; set; }

Property Value

EventCallback<EditContext>

Orientation

Defines the orientation of the form in terms of label and form editor position. Default value is Vertical.

Declaration

cs-api-definition
[Parameter]
public FormOrientation Orientation { get; set; }

Property Value

FormOrientation

Size

Specifies the Size of the form. Default value is Medium.

Declaration

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

Property Value

string

ValidationMessageType

Defines the way the validation errors should be displayed. Default value is Inline.

Declaration

cs-api-definition
[Parameter]
public FormValidationMessageType ValidationMessageType { get; set; }

Property Value

FormValidationMessageType

Width

Defines the width of the form.

Declaration

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

Property Value

string

Methods

BuildRenderTree(RenderTreeBuilder)

Declaration

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

Parameters

builder

RenderTreeBuilder

Overrides ComponentBase.BuildRenderTree(RenderTreeBuilder)

IsValid()

Validates the form and checks whether is valid or not.

Declaration

cs-api-definition
public bool IsValid()

Returns

bool

OnParametersSet()

Declaration

cs-api-definition
protected override void OnParametersSet()

Overrides ComponentBase.OnParametersSet()

Refresh()

Re-renders the component.

Declaration

cs-api-definition
public void Refresh()

SetParametersAsync(ParameterView)

Declaration

cs-api-definition
public override Task SetParametersAsync(ParameterView parameters)

Parameters

parameters

ParameterView

Returns

Task

Overrides ComponentBase.SetParametersAsync(ParameterView)