Searching and Filtering in Blazor TreeView Component

28 Aug 202412 minutes to read

The Blazor TreeView component allows for searching and filtering of TreeView nodes through an external input TextBox.

@using Syncfusion.Blazor.Inputs
@using Syncfusion.Blazor.Navigations

<div id="container">
    <div id="sample">
        <SfTextBox Placeholder="Filter" Input="@OnInput"></SfTextBox>
        <SfTreeView @ref="tree" ID="tree" TValue="Listdata">
            <TreeViewEvents TValue="Listdata" DataBound="dataBound"></TreeViewEvents>
            <TreeViewFieldsSettings DataSource="@ListDataSource" TValue="Listdata" Id="Id" IconCss="Icon" ParentID="Pid" Text="Name" HasChildren="HasChild" Expanded="Expanded"></TreeViewFieldsSettings>
        </SfTreeView>
    </div>
</div>
@code
{
    SfTreeView<Listdata> tree;
    List<Listdata> ListDataSource = new List<Listdata>();
    List<Listdata> Temp = new List<Listdata>();
    public bool isFiltered = false;
    List<Listdata> DataSource = new List<Listdata>();
    protected override void OnInitialized()
    {
        ListDataSource = GetData();
    }

    public List<Listdata> GetData()
    { 
        
        List<Listdata> TempDataSource = new List<Listdata>(){
                new Listdata
            {
                Id = 1,
                Name = "Australia",
                HasChild = true,
                Expanded = false,
                Icon = "folder"
            },new Listdata
    {
        Id = 2,
        Pid = 1,
        Name = "New South Wales",
         Icon = "folder"
    },new Listdata
    {
        Id = 3,
        Pid = 1,
        Name = "Victoria",
         Icon = "folder"
    },new Listdata
    {
        Id = 4,
        Pid = 1,
        Name = "South Australia",
        Icon = "folder"
    },new Listdata
    {
        Id = 6,
        Pid = 1,
        Name = "Western Australia",
        Icon = "folder"
    },new Listdata
    {
        Id = 7,
        Name = "Brazil",
        HasChild = true,
        Icon = "folder"
    },new Listdata
    {
        Id = 8,
        Pid = 7,
        Name = "ParanĂ¡",
        Icon = "folder"
    },new Listdata
    {
        Id = 9,
        Pid = 7,
        Name = "CearĂ¡",
        Icon = "folder"
    },new Listdata
    {
        Id = 10,
        Pid = 7,
        Name = "Acre",
        Icon = "folder"
    },new Listdata
    {
        Id = 11,
        Name = "China",
        HasChild = true,
        Icon = "folder"
    },new Listdata
    {
        Id = 12,
        Pid = 11,
        Name = "Guangzhou",
        Icon = "folder"
    },new Listdata
    {
        Id = 13,
        Pid = 11,
        Name = "Shanghai",
        Icon = "folder"
    },new Listdata
    {
        Id = 14,
        Pid = 11,
        Name = "Beijing",
        Icon = "folder"
    },new Listdata
    {
        Id = 15,
        Pid = 11,
        Name = "Shantou",
        Icon = "folder"
    },new Listdata
    {
        Id = 16,
        Name = "France",
        Icon = "folder",
        HasChild = true
    },new Listdata
    {
        Id = 17,
        Pid = 16,
        Name = "Pays de la Loire",
        Icon = "folder"
    },new Listdata
    {
        Id = 18,
        Pid = 16,
        Name = "Aquitaine",
         Icon = "folder"
    },new Listdata
    {
        Id = 19,
        Pid = 16,
        Name = "Brittany",
         Icon = "folder"
    },new Listdata
    {
        Id = 20,
        Pid = 16,
        Name = "Lorraine",
         Icon = "folder"
    },new Listdata
    {
        Id = 21,
        Name = "India",
        HasChild = true,
         Icon = "folder"
    },new Listdata
    {
        Id = 22,
        Pid = 21,
        Name = "Assam",
         Icon = "folder"
    },new Listdata
    {
        Id = 23,
        Pid = 21,
        Name = "Bihar",
         Icon = "folder"
    },new Listdata
    {
        Id = 24,
        Pid = 21,
        Name = "Tamil Nadu",
         Icon = "folder"
    }



};

        return TempDataSource;
    }

    public void OnInput(InputEventArgs eventArgs)
    {
        if (eventArgs.Value == "")
        {
            ListDataSource = GetData();
            isFiltered = false;
        }
        else
       {
            DataSource = GetData();
            // Filter all the nodes of the Searched ID.
            List<Listdata> filteredValues = DataSource.FindAll(e => e.Name.ToString().StartsWith(eventArgs.Value));
            List<Listdata> filteredDataSource = new List<Listdata>();
            Listdata data = new Listdata();
            for (int i = 0; i < filteredValues.Count; i++)
            {
                data = filteredValues[i];
                if(data.Pid == null)
                {
                    data.HasChild = false;
                    filteredDataSource.Add(data);
                    break;
                }
                while (data.Pid != null)
                {
                    if (filteredDataSource.Exists(e => e.Id.Equals(data.Id))) { break; }
                    filteredDataSource.Add(data);
                    data = DataSource.Find(e => e.Id.Equals(data.Pid));
                }
                if (!filteredDataSource.Exists(e => e.Id.Equals(data.Id)))
                {
                    filteredDataSource.Add(data);
                }
            }
            // Update the TreeView based on the searched ID value.
            ListDataSource = filteredDataSource;
            isFiltered = true;
        }
    }



    public void dataBound()
    {
        if (isFiltered)
        {
            this.tree.ExpandAll();
        }
        else
        {
            this.tree.CollapseAllAsync();
        }
    }



    public class Listdata
    {
        public int Id { get; set; }
        public int? Pid { get; set; } = null;
        public string Name { get; set; }
        public bool HasChild { get; set; }
        public bool Expanded { get; set; }
        public string Icon { get; set; }
    } 
}

<style>
    #tree {
        box-shadow: 0 1px 4px #ddd;
        border-bottom: 1px solid #ddd;
    }

    .e-treeview .e-list-icon {
        background-repeat: no-repeat;
        height: 20px;
        background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACcAAAJxCAYAAADB66v2AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAGymlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDAgNzkuMTYwNDUxLCAyMDE3LzA1LzA2LTAxOjA4OjIxICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3N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WocDkqXI6K4JXwlbOrPehtR5jTCXj6hvw6/axd0n8fwuO2AZFKeCKVCOtzAy4nwlxOocUMCabzVk94BKCMANR6RMXNgXrkvQhX+n/Ju/WLJcMj58XjtsHe8hnsLZ9BobkNUXFzoYqbw1yu6Gf8zu5zcHafE0VO1tHK5ahwOQCw1+0QfD4QMrmey58Ifo0kcpFRN//2jcfdLbgcSeRixqwXpRxJ5G6cwqhIkhNmmU+vR3DNBepPUkE+4+9pO+JxdX+JXuuJ/mXUdYzKeIv5cy8muRuxt/zV47CWwNl9Tn5yUsCnLypcjgqXo8LlqMhaTvCqpOX0Y54wbwpCwOwSklwJwsLhUajgUUYjUjUaCmUywsKj4HF1wePqRJ+zAx5XZ/9tVxfgcQt+C7qcF48brp5quHqqEaGMhypuHtT6bIRHxvo9rf3kKvT1NodY7jrcjmbYGnfC1rQLSt00ROnvglI3BQDb4kTcgPD0wWEtgbX613A7rjAXJ+tolbWcBCc4YVDFzkCEIo65JFHlIqNGoy/sNrTWHMOVqrVQapMRq89Eb9OnpPJEbdZI7Uw0V2xHXEoORk14DH2uHljbWxEWrkRv02fDmyvpc7mhihkPV/cRqPXpiDFmw9XThjBFLGy1fxJcnmhyqtiZcNra4e5tg0I7D/Y2M3o6zHDZm6Ec9XV43L2CyxSlz4VFaNDV0oHmis0AgKrDJ/wed9qbYEyfJ7hcUWouQjESvZ11vvth4QpEqq5Fq7O7AeHKkcMjdyP68Q8hedZLzOWI0qx9Tv9fDOrpqERkFHumSbCcQjUGbrcVfe5OwOPqPxgWCeDa71Hbmk/A1nLS73XhUcIvuhIsF5v+ot9Sw2Et9rgdzegLuwxr3UEAHng8br91XHR8JqISFwleovBcCRUuR4XLUeFyVLgcFS5HhctR4XJUuBwVLkeFy1HhclS4HJV/ARGJbJUliPF3AAAAAElFTkSuQmCC);
    }

        .e-treeview .e-list-icon.folder {
            background-position: -10px -552px
        }
    #sample {
        height: 220px;
        margin: 0 auto;
        display: block;
        max-width: 350px;
    }
    .e-treeview .e-list-icon.docx {
        background-position: -10px -20px
    }
</style>

Searching and Filtering in Blazor TreeView Component