alexa
menu

Blazor

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

    Show / Hide Table of Contents

    Class Template

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    Template
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    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 Template : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

    Constructors

    Template()

    Declaration
    public Template()

    Properties

    ChildContent

    Gets or sets the content to be rendered inside the associated FormItem within the data form.

    Declaration
    [Parameter]
    public RenderFragment ChildContent { get; set; }
    Property Value
    Type Description
    RenderFragment

    A RenderFragment representing the template fragment rendered as the body of the FormItem. The default value is null.

    Remarks

    This property allows you to provide custom content or UI components that will be injected within the FormItem context. Typical usage includes defining forms, layouts, and editors for structured data forms in Blazor components.

    Examples

    The following example demonstrates how to define a custom template using the ChildContent property:

    <FormItem Field="@nameof(SampleModel.Value)">
        <Template>
            <InputText @bind-Value="@SampleModel.Value" class="e-input" />
        </Template>
    </FormItem>

    Methods

    Dispose()

    Releases all resources used by the Template component.

    Declaration
    public virtual void Dispose()
    Remarks

    This method should be called when the component is no longer needed, to ensure that all resources are appropriately disposed and memory is freed. Invokes Dispose(bool) with true parameter to perform resource cleanup.

    Examples

    The following demonstrates how to dispose the template component manually:

    var template = new Template();
    template.Dispose();

    Dispose(bool)

    Disposes the resources (managed and unmanaged) used by the Template component.

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

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    Overrides
    OwningComponentBase.Dispose(bool)
    Remarks

    This method is called from Dispose() to free resources held by this component and to nullify references for garbage collection. Override this method in a derived class to customize disposal logic.

    OnInitializedAsync()

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type
    Task
    Overrides
    ComponentBase.OnInitializedAsync()

    Implements

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