Form Blazor API

Form Properties

NameTypeDefaultDescription
Columnsint1Sets or gets the form columns.
ControlsIEnumerable<IControl>N/ASets or gets the form controls.
OnStatusChangesobjectN/ACallback function for handling status changes
OnValueChangesobjectN/ACallback function for handling value changes
LabelPositionFormLabelPositionFormLabelPosition.LeftSets or Gets the labels position.
ReadonlyboolfalseMakes the form readonly.
ShowColonAfterLabelboolfalseShows / hides the colon after the labels.
ShowSummarybooltrueShows / hides validation summary.
StateobjectN/AGets the Form's state. Each member in the state has { dirty, untouched, disabled } properties.
ValueobjectN/AGets or Sets the Form value.

Form Methods

NameTypeArgumentsDescription
AddControlvoidobject controlOptionsAdds a control to the Form.Args: object controlOptions - Control options. The control options description is available in the "controls" property.
GetControlControlstring dataFieldGets a control by its name(dataField).Args: string dataField - dataField of a FormControl or FormGroup
GetValueAsync()Task<object>'N/A'Gets the &quot;Value&quot; property as Task&lt;object&gt;.
InsertControlvoidint index, object controlOptionsInserts a control to the Form.Args: int index - Control insert index,object controlOptions - Control options. The control options description is available in the "controls" property.
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
RemoveControlvoidobject controlOptionsRemove a control from the Form.Args: object controlOptions - Control options. The control options description is available in the "controls" property.
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
ResetvoidN/AClears the form.
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.
Submitvoidobject submitOptionsSubmits the form.Args: object submitOptions - Sets the submit options object. The object may have the following properties: "async", "action", "target", "method". "async" determines whether the form will be submitted asynchronously. "action" determines the submit url, "method" sets whether the submit is through 'GET' or 'POST'. "target" determines the submit target.
SubmitvoidN/ASubmits the form.
ValidatevoidN/AValidates the form.

Enums

ControlControlType

ControlControlType.Button
ControlControlType.Boolean
ControlControlType.ComboBox
ControlControlType.CheckInput
ControlControlType.Datetime
ControlControlType.DropDownList
ControlControlType.Group
ControlControlType.Input
ControlControlType.Label
ControlControlType.MultiInput
ControlControlType.MultiComboInput
ControlControlType.Mask
ControlControlType.Number
ControlControlType.Password
ControlControlType.RadioButton
ControlControlType.Submit
ControlControlType.Textarea
ControlControlType.Template

ControlControlControlType

ControlControlControlType.Button
ControlControlControlType.Boolean
ControlControlControlType.ComboBox
ControlControlControlType.CheckInput
ControlControlControlType.Datetime
ControlControlControlType.DropDownList
ControlControlControlType.Group
ControlControlControlType.Input
ControlControlControlType.Label
ControlControlControlType.MultiInput
ControlControlControlType.MultiComboInput
ControlControlControlType.Mask
ControlControlControlType.Number
ControlControlControlType.Password
ControlControlControlType.RadioButton
ControlControlControlType.Submit
ControlControlControlType.Textarea
ControlControlControlType.Template

ControlControlLabelPosition

ControlControlLabelPosition.Left
ControlControlLabelPosition.Top

ControlControlViewMode

ControlControlViewMode.Null
ControlControlViewMode.Accordion
ControlControlViewMode.Tabs
ControlControlViewMode.Breadcrumb

ControlLabelPosition

ControlLabelPosition.Left
ControlLabelPosition.Top

ControlViewMode

ControlViewMode.Null
ControlViewMode.Accordion
ControlViewMode.Tabs
ControlViewMode.Breadcrumb

FormLabelPosition

FormLabelPosition.Left
FormLabelPosition.Top

Control Properties

NameTypeDefaultDescription
Appendstring""HTML Content displayed after the Form Control
ControlOptionsobjectnullJSON object with initialization properties of the UI component. Example: { dataSource: ['item 1', 'item 2', 'item 3'] } will set the dataSource property of the Form control.
ControlTypeControlControlTypeControlControlType.InputThe type of the control.
Columnsint1Sets the Form Group columns.
ColumnSpanint1Sets the Form control column span.
ControlsIEnumerable<IControlControl>null
DataFieldstring""Sets the Form control data field. The control's inner input's name is set to the dataField value and in the FormGroup it is accessible through the dataField value.
DisabledboolfalseSets the Form control disabled mode.
DirtyboolfalseGets whether the Form control is 'dirty' i.e its value is changed by the user.
Infostring""Gets or Sets the Form control's info icon's tooltip.
InvalidboolfalseGets whether the Form control is invalid.
Labelstring""Gets or Sets the Form control's label.
LabelPositionControlLabelPositionControlLabelPosition.LeftGets or Sets the Form control's label position.
LabelOffsetint10Gets or Sets the offset between the label and the control.
LabelAlignstring"left"FormGroup only(when controlType is set to 'group'). Gets or Sets whether the navigation buttons are displayed. The property has effect when the viewMode property is set.
NextButtonLabelstring"Next"FormGroup only(when controlType is set to 'group'). Gets or Sets the next button label.
BackButtonLabelstring"Back"FormGroup only(when controlType is set to 'group'). Gets or Sets the back button label.
Prependstring""HTML Content displayed before the Form Control
ReadonlyboolfalseGets or Sets the Form control readonly mode.
UntouchedboolfalseGets whether the Form control is not touched by the user. This flag is changed usually on blur, after the user interacted with the Form control
Placeholderstring""Gets or Sets the placeholder.
ShowButtonsboolfalseFormGroup only(when controlType is set to 'group'). Gets or Sets whether the navigation buttons are displayed. The property has effect when the viewMode property is set.
ValueobjectnullSets or Gets the Form control or Form group value.
ValidboolfalseGets whether the Form control is valid.
ValidationRulesIEnumerable<object>nullSets or gets the column's validation rules. The expected value is an Array of Objects. Each object should have a 'type' property that can be set to 'required', 'min', 'max', 'minLength', 'maxLength', 'email', 'null', 'requiredTrue', 'minData', 'maxDate', 'pattern'. The 'value' property should be set, too. For validation rule types 'required', 'requiredTrue' and 'null' you can skip the 'value' property. Optional property is 'message', which determines the error message.
ViewModeControlViewModeControlViewMode.NullFormGroup only(when controlType is set to 'group'). Gets or Sets the form'group view mode.

ControlControl Properties

NameTypeDefaultDescription
Appendstring""HTML Content displayed after the Form Control
ControlOptionsobjectnullJSON object with initialization properties of the UI component. Example: { dataSource: ['item 1', 'item 2', 'item 3'] } will set the dataSource property of the Form control.
ControlTypeControlControlControlTypeControlControlControlType.InputThe type of the control.
Columnsint1Sets the Form Group columns.
ColumnSpanint1Sets the Form control column span.
DataFieldstring""Sets the Form control data field. The control's inner input's name is set to the dataField value and in the FormGroup it is accessible through the dataField value.
DisabledboolfalseSets the Form control disabled mode.
DirtyboolfalseGets whether the Form control is 'dirty' i.e its value is changed by the user.
Infostring""Gets or Sets the Form control's info icon's tooltip.
InvalidboolfalseGets whether the Form control is invalid.
Labelstring""Gets or Sets the Form control's label.
LabelPositionControlControlLabelPositionControlControlLabelPosition.LeftGets or Sets the Form control's label position.
LabelOffsetint10Gets or Sets the offset between the label and the control.
LabelAlignstring"left"FormGroup only(when controlType is set to 'group'). Gets or Sets whether the navigation buttons are displayed. The property has effect when the viewMode property is set.
NextButtonLabelstring"Next"FormGroup only(when controlType is set to 'group'). Gets or Sets the next button label.
BackButtonLabelstring"Back"FormGroup only(when controlType is set to 'group'). Gets or Sets the back button label.
Prependstring""HTML Content displayed before the Form Control
ReadonlyboolfalseGets or Sets the Form control readonly mode.
UntouchedboolfalseGets whether the Form control is not touched by the user. This flag is changed usually on blur, after the user interacted with the Form control
Placeholderstring""Gets or Sets the placeholder.
ShowButtonsboolfalseFormGroup only(when controlType is set to 'group'). Gets or Sets whether the navigation buttons are displayed. The property has effect when the viewMode property is set.
ValueobjectnullSets or Gets the Form control or Form group value.
ValidboolfalseGets whether the Form control is valid.
ValidationRulesIEnumerable<object>nullSets or gets the column's validation rules. The expected value is an Array of Objects. Each object should have a 'type' property that can be set to 'required', 'min', 'max', 'minLength', 'maxLength', 'email', 'null', 'requiredTrue', 'minData', 'maxDate', 'pattern'. The 'value' property should be set, too. For validation rule types 'required', 'requiredTrue' and 'null' you can skip the 'value' property. Optional property is 'message', which determines the error message.
ViewModeControlControlViewModeControlControlViewMode.NullFormGroup only(when controlType is set to 'group'). Gets or Sets the form'group view mode.