FormGroup Blazor API

FormGroup Properties

NameTypeDefaultDescription
Columnsint1Sets or gets the form columns.
ControlsIEnumerable<IFormGroupControl>N/A
OnStatusChangesobjectN/ACallback function for handling status changes
OnValueChangesobjectN/ACallback function for handling value changes
LabelPositionFormGroupLabelPositionFormGroupLabelPosition.LeftSets or Gets the labels position.
ReadonlyboolfalseMakes the form readonly.
ShowColonAfterLabelboolfalseShows / hides the colon after the labels.
ShowSummarybooltrueShows / hides validation summary.
ValueobjectN/AGets or Sets the Form value.

FormGroup 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.
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.

Enums

FormGroupControlControlType

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

FormGroupControlLabelPosition

FormGroupControlLabelPosition.Left
FormGroupControlLabelPosition.Top

FormGroupControlViewMode

FormGroupControlViewMode.Null
FormGroupControlViewMode.Accordion
FormGroupControlViewMode.Tabs
FormGroupControlViewMode.Breadcrumb

FormGroupLabelPosition

FormGroupLabelPosition.Left
FormGroupLabelPosition.Top

FormGroupControl Properties

NameTypeDefaultDescription
AppendHTMLobject""HTML Content displayed after the Form Control
ControlOptionsobject""JSON 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.
ControlTypeFormGroupControlControlTypeFormGroupControlControlType.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.
LabelPositionFormGroupControlLabelPositionFormGroupControlLabelPosition.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.
PrependHTMLobject""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
ShowColonAfterLabelboolfalseGets or Sets whether colon is displayed after the label.
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.
ViewModeFormGroupControlViewModeFormGroupControlViewMode.NullFormGroup only(when controlType is set to 'group'). Gets or Sets the form'group view mode.