alexa
menu

Blazor

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

    Show / Hide Table of Contents

    Class TreeGridTemplates

    Configures Tree Grid templates.

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

    Constructors

    TreeGridTemplates()

    Declaration
    public TreeGridTemplates()

    Properties

    DetailTemplate

    Gets or sets the template to customize detail row element.

    Declaration
    [Parameter]
    [JsonIgnore]
    public RenderFragment<object> DetailTemplate { get; set; }
    Property Value
    Type
    RenderFragment<object>
    Remarks

    Use the DetailTemplate to render hierarchy treegrid. It supports N level of nested grids. The parameters passed to the templates can be accessed using the implicit parameter named context. The context is a type of TValue.

    EmptyRecordTemplate

    Gets or sets the template that represents custom content displayed when there are no records in the SfTreeGrid<TValue>.

    Declaration
    [Parameter]
    [JsonIgnore]
    public RenderFragment<EmptyRecordTemplateContext> EmptyRecordTemplate { get; set; }
    Property Value
    Type Description
    RenderFragment<EmptyRecordTemplateContext>

    A RenderFragment representing the UI fragment shown when the Tree Grid is empty.

    Remarks

    This property allows developers to define a custom UI fragment that is rendered instead of the default content when the SfTreeGrid<TValue> contains no data.

    Set this property to a RenderFragment to display messages, icons, illustrations, or interactive elements for empty states.

    If EmptyRecordTemplate is not set, the Tree Grid displays its built-in "No records to display."

    Examples

    The following example demonstrates how to display a custom message when there are no records in the Tree Grid.

    <SfTreeGrid DataSource="data">
        <EmptyRecordTemplate Context="context">
            <div style="text-align:center;">
                <span class="e-icons e-error"></span>
                <p>No records available.</p>
            </div>
        </EmptyRecordTemplate>
    </SfTreeGrid>

    RowTemplate

    Gets or sets the row template to customize row elements.

    Declaration
    [Parameter]
    [JsonIgnore]
    public RenderFragment<object> RowTemplate { get; set; }
    Property Value
    Type
    RenderFragment<object>
    Remarks

    The RowTemplate content must be TD elements and the number of TD elements must match the number of datagrid columns. The parameters passed to the templates can be accessed using the implicit parameter named context. The context is a type of TValue.

    ToolbarTemplate

    Render custom toolbar using the ToolbarTemplate property. It replaces the in-built toolbar and click actions must be handled in the custom toolbar itself.

    Declaration
    [Parameter]
    [JsonIgnore]
    public RenderFragment<object> ToolbarTemplate { get; set; }
    Property Value
    Type
    RenderFragment<object>
    Remarks

    The parameters passed to the templates can be accessed using implicit parameter named context.

    Methods

    OnInitializedAsync()

    Method invoked when the component is ready to start, having received its initial parameters from its parent in the render tree. Override this method if you will perform an asynchronous operation and want the component to refresh when that operation is completed.

    Declaration
    protected override Task OnInitializedAsync()
    Returns
    Type Description
    Task

    A System.Threading.Tasks.Task representing any asynchronous operation.

    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