alexa
menu

Blazor

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

    Show / Hide Table of Contents

    Class UploaderTemplates

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    UploaderTemplates
    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.Dispose(bool)
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.Inputs
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class UploaderTemplates : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

    Constructors

    UploaderTemplates()

    Declaration
    public UploaderTemplates()

    Properties

    Template

    Gets or sets the template used to render custom content for uploaded files in the SfUploader component.

    Declaration
    [Parameter]
    public RenderFragment<FileInfo> Template { get; set; }
    Property Value
    Type Description
    RenderFragment<FileInfo>

    A RenderFragment<TValue> of type FileInfo that defines the custom template content. The default value is null.

    Remarks

    This property allows you to define a custom template for displaying uploaded files in the uploader component. The template receives a FileInfo context object that contains information about the uploaded file. When this property is set, the template will be applied to each file item in the uploader's file list.

    Examples

    The following example demonstrates how to use a custom template for file display:

    <SfUploader>
        <UploaderTemplates>
            <Template>
                <div class="custom-file-item">
                    <span>@context.Name</span>
                    <span>(@context.Size bytes)</span>
                </div>
            </Template>
        </UploaderTemplates>
    </SfUploader>

    Methods

    BuildRenderTree(RenderTreeBuilder)

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

    OnInitializedAsync()

    Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    Task

    A Task that represents the asynchronous initialization operation.

    Overrides
    ComponentBase.OnInitializedAsync()
    Remarks

    This method is called once during the component's lifecycle, after the component has been constructed and has received its initial set of parameters. It registers the template with the parent SfUploader component if a template is provided.

    Implements

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