New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Kendo UI FormItem TagHelper

Definition

Namespace:Kendo.Mvc.TagHelpers

Assembly:Kendo.Mvc.dll

Syntax:

C#
[HtmlTargetElement("form-item", ParentTag = "form-items", TagStructure = TagStructure.NormalOrSelfClosing)]
[RestrictChildren("col-spans", new string[] { "item-label", "form-items", "dropdownlist-editor", "autocomplete-editor", "combobox-editor", "multiselect-editor", "multicolumncombobox-editor", "dropdowntree-editor", "dateinput-editor", "datepicker-editor", "datetimepicker-editor", "timepicker-editor", "numerictextbox-editor", "maskedtextbox-editor", "switch-editor", "rating-editor", "slider-editor", "colorpicker-editor", "flatcolorpicker-editor", "colorgradient-editor", "colorpalette-editor", "richtexteditor-editor", "radiogroup-editor", "checkboxgroup-editor", "textbox-editor", "textarea-editor", "captcha-editor", "grid", "signature-editor", "timedurationpicker-editor", "otpinput-editor", "upload-editor" })]
[SuppressTagRendering]
public class FormItemTagHelper : TagHelperCollectionItemBase, ITagHelper, ITagHelperComponent, IFormItem, IEditorContainer

Inheritance: objectTagHelperTagHelperChildBaseTagHelperCollectionItemBaseFormItemTagHelper

Implements: IEditorContainerIFormItemITagHelperITagHelperComponent

Inherited Members TagHelperChildBase.Init(TagHelperContext)TagHelperChildBase.AddSelfToContext(TagHelperContext)TagHelperChildBase.CreateHandler(string)TagHelperChildBase.IdPrefixTagHelper.Process(TagHelperContext, TagHelperOutput)TagHelper.Orderobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Example:

csharp
@addTagHelper *, Kendo.Mvc

<kendo-form name="form">
    <form-items>
        <form-item field="MyProperty" col-span="2"></form-item>
    </form-items>
</kendo-form>

Constructors

Initializes a new instance of the FormItemTagHelper class.

C#
public FormItemTagHelper()

Properties

Defines the field size when grid layout is used. Use this setting to configure the colSpan as a fixed number.

C#
[HtmlAttributeName("col-span")]
public double? ColSpanNumber { get; set; }

Defines the editor widget type. The valid options are as follows: DropDown widgets - "AutoComplete", "DropDownList", "ComboBox", "MultiSelect", "DropDownTree", "MultiColumnComboBox"; DatePicker widgets - "DateInput", "DatePicker", "DateTimePicker", "TimePicker"; Input widgets - "TextBox", "TextArea", "NumericTextBox", "MaskedTextBox", "RadioGroup", "CheckBoxGroup", "Switch", "Rating", "Slider", "ColorPicker", "ColorGradient", "ColorPalette", "FlatColorPicker", "Signature", "OTPInput", "hidden"; Editor widget - "Editor" or Upload widget - "Upload". Important - The casing of the editor must be exactly as shown, combobox is not the same as ComboBox.For any other input, specify the editor as a function that returns the HTML of the element which you wish to render.

C#
public string Editor { get; set; }

Implements: IEditorContainer.Editor

Defines the editor widget type. The valid options are as follows: DropDown widgets - "AutoComplete", "DropDownList", "ComboBox", "MultiSelect", "DropDownTree", "MultiColumnComboBox"; DatePicker widgets - "DateInput", "DatePicker", "DateTimePicker", "TimePicker"; Input widgets - "TextBox", "TextArea", "NumericTextBox", "MaskedTextBox", "RadioGroup", "CheckBoxGroup", "Switch", "Rating", "Slider", "ColorPicker", "ColorGradient", "ColorPalette", "FlatColorPicker", "Signature", "OTPInput", "hidden"; Editor widget - "Editor" or Upload widget - "Upload". Important - The casing of the editor must be exactly as shown, combobox is not the same as ComboBox.For any other input, specify the editor as a function that returns the HTML of the element which you wish to render.

C#
public string EditorHandler { get; set; }

The editor options for the built-in editor.

C#
[HtmlAttributeNotBound]
public IDictionary<string, object> EditorOptions { get; set; }

Implements: IEditorContainer.EditorOptions

Defines the id for the EditorTemplate.

C#
public string EditorTemplateId { get; set; }

Defines the HTML content for the EditorTemplate.

C#
public IHtmlContent EditorTemplateView { get; set; }

Maps to the model field which will be configured and sets the name of the input.

C#
public string Field { get; set; }

Implements: IFormItem.Field

Specifies the hidden state of the Editor.

C#
public bool HiddenEditor { get; set; }

Defines the hint text that will be shown underneath the form editor.

C#
public string Hint { get; set; }

Defines the attributes that are applied to the input element.

C#
public IDictionary<string, object> HtmlAttributes { get; set; }

Defines the field id.

C#
public string Id { get; set; }

Configures the label settings for the FormItem.

C#
[HtmlAttributeNotBound]
public IFormItemLabelSettings Label { get; set; }

Implements: IFormItem.Label

Specify the layout of the item when items.type is set to "group". Valid options: grid: This is equivalent to display: grid. It defines the form item as a grid container and establishes a new grid formatting context for its contents..

C#
public string Layout { get; set; }

Metadata member.

C#
public ModelMetadata Metadata { get; set; }

Implements: IFormItem.Metadata

Defines the field title.

C#
public string Title { get; set; }

Implements: IFormItem.Title

Defines the type of the item. Available options: "group".

C#
public string Type { get; set; }

Methods

Adds the current TagHelper instance to its parent TagHelper.

C#
protected override void AddSelfToParent(TagHelperContext context)
Parameters:contextTagHelperContext

The TagHelper context.

Overrides: TagHelperChildBase.AddSelfToParent(TagHelperContext)

C#
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Parameters:contextTagHelperContextoutputTagHelperOutputReturns:

Task

Overrides: TagHelperChildBase.ProcessAsync(TagHelperContext, TagHelperOutput)

Serializes the defined settings.

C#
public Dictionary<string, object> Serialize()
Returns:

Dictionary<string, object>

Implements: IFormItem.Serialize()