alexa
menu

Blazor

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

    Show / Hide Table of Contents

    Class TreeViewFieldOptions<TValue>

    A class used for configuring the TreeView fields setting properties.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    TreeViewFieldOptions<TValue>
    TreeViewFieldChild<TValue>
    TreeViewFieldsSettings<TValue>
    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.Navigations
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class TreeViewFieldOptions<TValue> : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    Type Parameters
    Name Description
    TValue

    "Specifies the TValue parameter".

    Constructors

    TreeViewFieldOptions()

    Declaration
    public TreeViewFieldOptions()

    Properties

    Child

    Gets or sets the string value that represents the name of the child data source holding a list of objects.

    Declaration
    [Parameter]
    public string Child { get; set; }
    Property Value
    Type
    string
    Examples
    <SfTreeView TValue="MailItem" >
        <TreeViewFieldsSettings TValue="MailItem" Child="SubFolders" DataSource="@MyFolder" Text="FolderName"></TreeViewFieldsSettings>
    </SfTreeView>
    @code{ 
        public class MailItem
        {
           public string FolderName { get; set; }
           public List<MailItem> SubFolders { get; set; }
        }
        List<MailItem> MyFolder = new List<MailItem>();
        List<MailItem> Folder1 = new List<MailItem>();
        MyFolder.Add(new MailItem
        {
            SubFolders = Folder1
        });

    DataManager

    The DataManager class provides functionality for performing data operations in applications. It serves as an abstraction layer for working with remote data sources.

    Declaration
    public DataManager DataManager { get; set; }
    Property Value
    Type
    DataManager

    DataSource

    Gets or sets the data source for rendering the TreeView component. The data source value can be of any type that implements IEnumerable.

    Declaration
    [Parameter]
    public IEnumerable<TValue> DataSource { get; set; }
    Property Value
    Type
    IEnumerable<TValue>

    Expanded

    Gets or sets the mapping field for the expand state of the TreeView node.

    Declaration
    [Parameter]
    public string Expanded { get; set; }
    Property Value
    Type
    string

    HasChildren

    Gets or sets the mapping field for determining whether a node has child nodes or not.

    Declaration
    [Parameter]
    public string HasChildren { get; set; }
    Property Value
    Type
    string

    HtmlAttributes

    Gets or sets the mapping field for adding custom HTML attributes to the TreeView node.

    Declaration
    [Parameter]
    public string HtmlAttributes { get; set; }
    Property Value
    Type
    string
    Examples
    <SfTreeView TValue="MailItem" >
        <TreeViewFieldsSettings TValue="MailItem" Id="Id" HtmlAttributes="HtmlAttributes"></TreeViewFieldsSettings>
    </SfTreeView>
    @code{ 
        Dictionary<string, object> HtmlAttributes = new Dictionary<string, object>() 
       { 
           { "class", "treeview" } 
       };

    IconCss

    Gets or sets the mapping field for the icon class of each TreeView node, which will be added before the node's text.

    Declaration
    [Parameter]
    public string IconCss { get; set; }
    Property Value
    Type
    string

    Id

    Gets or sets the Id field mapped in the dataSource.

    Declaration
    [Parameter]
    public string Id { get; set; }
    Property Value
    Type
    string

    ImageUrl

    Gets or sets the mapping field for the image URL of each TreeView node, where the image will be added before the node's text.

    Declaration
    [Parameter]
    public string ImageUrl { get; set; }
    Property Value
    Type
    string

    IsChecked

    Gets or sets the field for the checked state of the TreeView node.

    Declaration
    [Parameter]
    public string IsChecked { get; set; }
    Property Value
    Type
    string

    NavigateUrl

    Gets or sets the mapping field for navigateUrl to add it as the hyperlink of the TreeView node.

    Declaration
    [Parameter]
    public string NavigateUrl { get; set; }
    Property Value
    Type
    string

    ParentID

    Gets or sets the parent ID field mapped in the dataSource.

    Declaration
    [Parameter]
    public string ParentID { get; set; }
    Property Value
    Type
    string

    Query

    Gets or sets the query to select particular data from the dataSource.

    Declaration
    [Parameter]
    public Query Query { get; set; }
    Property Value
    Type
    Query
    Examples
    <SfTreeView TValue="TreeData">
        <TreeViewFieldsSettings TValue="TreeData" Query="@Query" Id="EmployeeID" Text="FirstName" >
            <SfDataManager Url="http://services.odata.org/V4/Northwind/Northwind.svc" Adaptor="@Syncfusion.Blazor.Adaptors.ODataV4Adaptor" CrossDomain="true">
            </SfDataManager>
        </TreeViewFieldsSettings>
    </SfTreeView>
    @code{ 
         public Query Query = new Query().From("Employees").Select(new List<string> { "EmployeeID", "FirstName" }).Take(5).RequiresCount();
    }

    Selected

    Gets or sets the mapping field for the selected state of the TreeView node.

    Declaration
    [Parameter]
    public string Selected { get; set; }
    Property Value
    Type
    string

    TableName

    Gets or sets the table name used to fetch data from a specific table in the server.

    Declaration
    [Parameter]
    public string TableName { get; set; }
    Property Value
    Type
    string

    Text

    Gets or sets the mapping field for the text displayed as the TreeView node's display text.

    Declaration
    [Parameter]
    public string Text { get; set; }
    Property Value
    Type
    string

    Tooltip

    Gets or sets the mapping field for the tooltip that will be displayed as hovering text of the TreeView node.

    Declaration
    [Parameter]
    public string Tooltip { get; set; }
    Property Value
    Type
    string

    Methods

    Dispose(bool)

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

    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