Class FormAutoGenerateItems
Provides an infrastructure component for the automatic generation of form items within the context of FormItems.
Inheritance
Namespace: Syncfusion.Blazor.DataForm
Assembly: Syncfusion.Blazor.dll
Syntax
public class FormAutoGenerateItems : OwningComponentBase
Remarks
This class is essential for the Syncfusion DataForm's auto-generation functionality. It simplifies the developer's workflow by automatically generating the necessary form items and facilitates the internal management of item lifecycles inside a FormItems container. It is not meant to be instantiated directly by users and primarily serves as a building block within the Syncfusion DataForm rendering architecture.
Examples
The following example demonstrates how to use FormAutoGenerateItems within a data form component to automatically generate form fields for an Employee model.
<SfDataForm Model="Employee">
<FormItems>
<FormAutoGenerateItems />
</FormItems>
</SfDataForm>
Constructors
FormAutoGenerateItems()
Declaration
public FormAutoGenerateItems()
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder | __builder |
Dispose(Boolean)
Releases all resources used by the FormAutoGenerateItems component and removes references when the component is disposed.
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Indicates whether this method was invoked by user code ( |
Remarks
This override ensures that references such as Syncfusion.Blazor.DataForm.FormAutoGenerateItems.Parent are set to null
to avoid memory leaks and dangling references.
It is a crucial part of proper resource management when the component is no longer in use and is being garbage collected or disposed from the component tree.
OnInitialized()
Performs component initialization and registers the FormAutoGenerateItems with its parent FormItems container for automatic form item generation.
Declaration
protected override void OnInitialized()
Remarks
This method is invoked during the component lifecycle initialization phase, ensuring that the FormAutoGenerateItems is recognized and integrated with its parent FormItems for proper item auto-generation support within the Syncfusion DataForm lifecycle.
Calls Parent?.UpdateItem(null, this)
internally as part of the registration mechanism for auto-generation.