alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class FormItems

    Represents the template and logic for automatically generating form items in a Syncfusion DataForm component.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    FormItems
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnAfterRenderAsync(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.DataForm
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class FormItems : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    Remarks

    Use the FormItems class to define and customize how form items are displayed, including support for templates, groupings, and automatic item generation. You can include HTML elements or other components inside the template.

    Examples

    This example demonstrates customizing the appearance and behavior of autogenerated items in Syncfusion DataForm:

    <SfDataForm Model="@model">
      <FormItems>
        <FormItem Field="FirstName"/>
        <FormItem Field="LastName"/>
      </FormItems>
    </SfDataForm>

    Constructors

    FormItems()

    Declaration
    public FormItems()

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    RenderTreeBuilder __builder
    Overrides
    ComponentBase.BuildRenderTree(RenderTreeBuilder)

    Dispose(bool)

    Releases the resources used by the FormItems component.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    A bool indicating whether to perform standard dispose logic.

    Overrides
    OwningComponentBase.Dispose(bool)
    Remarks

    Invokes clean-up and disposal of internal resources and parent-child component references.

    Examples
    protected override void Dispose(bool disposing)
    {
        base.Dispose(disposing);
    }

    GetAutogeneratedItems(List<PropertyInfo>, bool)

    Automatically generates items based on the provided model property metadata for use in the DataForm UI.

    Declaration
    protected void GetAutogeneratedItems(List<PropertyInfo> properties, bool isAutogeneration = false)
    Parameters
    Type Name Description
    List<PropertyInfo> properties

    A list of PropertyInfo reflecting the properties to be processed for DataForm item generation.

    bool isAutogeneration

    A bool flag indicating whether autogeneration is enabled. The default value is false.

    Remarks

    This method identifies properties that have not yet been included and generates DataForm items or groupings as appropriate. Use for dynamic DataForm construction.

    Examples
    protected override void OnInitialized()
    {
        GetAutogeneratedItems(typeof(Person).GetProperties().ToList());
    }

    OnInitializedAsync()

    Initializes the FormItems component and notifies its parent SfDataForm instance that items are rendered.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    Task

    A Task indicating the completion of initialization logic.

    Overrides
    ComponentBase.OnInitializedAsync()
    Remarks

    This method sets the IsFormItemsRendered flag on its parent DataForm for proper rendering and lifecycle management.

    Examples
    await base.OnInitializedAsync();

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved