DeepWorks Studios Blazor Component Library

Demo user Administrator ยท Blazor Server Library 20261206222504-6e8ff32.dirty

TreeTable

DwsTreeTable<T> renders hierarchical data as a table. Hierarchy is projected from your own model - either nested (ChildrenSelector) or a flat self-referencing list (ParentKeySelector) - so nothing has to derive from a library base type.

API Reference

Nested model

The common case: items that already contain their own children. ChildrenSelector hands the table each item's child collection; the first column hosts the expander by default. DefaultExpanded opens the first level only - the root rows, once - so 'src' is open and 'Components' below it is closed; to open every level call ExpandAllAsync(), to open one branch ExpandSubtreeAsync(node), or bind ExpandedKeys.

Project files, as a hierarchy
NameKindSize (KB)
srcFolder0
ComponentsFolder0
DwsTreeTable.razorRazor118
DwsTreeTable.razor.csC#642
StylesFolder0
_treetable.scssSCSS47
assetsFolder0
logo.svgImage12
screenshot.pngImage921
README.mdMarkdown8
Show Code
TreeTable.razor
<DwsTreeTable T="DemoFileNode" Name="TreeTableDemo_Basic" Items="@_fileTree" ChildrenSelector="@FileChildren" ItemKeySelector="@FileKey" DefaultExpanded="true" Caption="Project files, as a hierarchy">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Basic_Name" Field="Name" Title="Name" IsTreeColumn="true" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Basic_Kind" Field="Kind" Title="Kind" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Basic_Size" Field="SizeKb" Title="Size (KB)" Alignment="DwsHorizontalAlignment.Right" Width="120" />
    </DwsTreeTableColumns>
</DwsTreeTable>

@code {
    private sealed class DemoFileNode
    {
        public int Id { get; init; }
        public string Name { get; init; } = string.Empty;
        public string Kind { get; init; } = string.Empty;
        public int SizeKb { get; init; }
        public bool IsFolder => Children.Count > 0 || Kind == "Folder";
        public List<DemoFileNode> Children { get; init; } = [];
    }

    private static readonly Func<DemoFileNode, IEnumerable<DemoFileNode>?> FileChildren = node => node.Children;
    private static readonly Func<DemoFileNode, object> FileKey = node => node.Id;

    private readonly List<DemoFileNode> _fileTree =
    [
        new DemoFileNode
        {
            Id = 1, Name = "src", Kind = "Folder",
            Children =
            [
                new DemoFileNode
                {
                    Id = 2, Name = "Components", Kind = "Folder",
                    Children =
                    [
                        new DemoFileNode { Id = 3, Name = "DwsTreeTable.razor", Kind = "Razor", SizeKb = 118 },
                        new DemoFileNode { Id = 4, Name = "DwsTreeTable.razor.cs", Kind = "C#", SizeKb = 642 },
                    ],
                },
                new DemoFileNode
                {
                    Id = 5, Name = "Styles", Kind = "Folder",
                    Children = [new DemoFileNode { Id = 6, Name = "_treetable.scss", Kind = "SCSS", SizeKb = 47 }],
                },
            ],
        },
        new DemoFileNode
        {
            Id = 7, Name = "assets", Kind = "Folder",
            Children =
            [
                new DemoFileNode { Id = 8, Name = "logo.svg", Kind = "Image", SizeKb = 12 },
                new DemoFileNode { Id = 9, Name = "screenshot.png", Kind = "Image", SizeKb = 921 },
            ],
        },
        new DemoFileNode { Id = 10, Name = "README.md", Kind = "Markdown", SizeKb = 8 },
    ];
}

Flat self-referencing list

Data straight out of a database table: one flat list where each row points at its parent. ParentKeySelector rebuilds the hierarchy. Rows whose parent key is null — or points at something not in the list — become roots, so orphans stay visible instead of disappearing.

Organisation units, rebuilt from parent ids
UnitLeadHeadcount
EngineeringA. Weber48
PlatformS. Beji18
Component LibraryM. Klein7
InfrastructureT. Fischer11
ProductR. Hoffmann30
DesignK. Bauer9
Orphaned unit—1
Show Code
TreeTable.razor
<DwsTreeTable T="DemoOrgUnit" Name="TreeTableDemo_Flat" Items="@_orgUnits" ParentKeySelector="@UnitParentKey" ItemKeySelector="@UnitKey" DefaultExpanded="true" Caption="Organisation units, rebuilt from parent ids">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoOrgUnit" Name="TreeTableDemo_Flat_Title" Field="Title" Title="Unit" IsTreeColumn="true" />
        <DwsTreeTableColumn T="DemoOrgUnit" Name="TreeTableDemo_Flat_Lead" Field="Lead" Title="Lead" />
        <DwsTreeTableColumn T="DemoOrgUnit" Name="TreeTableDemo_Flat_Headcount" Field="Headcount" Title="Headcount" Alignment="DwsHorizontalAlignment.Right" Width="130" />
    </DwsTreeTableColumns>
</DwsTreeTable>

@code {
    private sealed class DemoOrgUnit
    {
        public int Id { get; init; }
        public int? ParentId { get; init; }   // null => root
        public string Title { get; init; } = string.Empty;
        public string Lead { get; init; } = string.Empty;
        public int Headcount { get; init; }
    }

    // ItemKeySelector is required in this mode: it is what ParentId is matched against.
    private static readonly Func<DemoOrgUnit, object?> UnitParentKey = unit => unit.ParentId;
    private static readonly Func<DemoOrgUnit, object> UnitKey = unit => unit.Id;

    private readonly List<DemoOrgUnit> _orgUnits =
    [
        new DemoOrgUnit { Id = 1, ParentId = null, Title = "Engineering", Lead = "A. Weber", Headcount = 48 },
        new DemoOrgUnit { Id = 2, ParentId = 1, Title = "Platform", Lead = "S. Beji", Headcount = 18 },
        new DemoOrgUnit { Id = 3, ParentId = 2, Title = "Component Library", Lead = "M. Klein", Headcount = 7 },
        new DemoOrgUnit { Id = 4, ParentId = 2, Title = "Infrastructure", Lead = "T. Fischer", Headcount = 11 },
        new DemoOrgUnit { Id = 5, ParentId = 1, Title = "Product", Lead = "R. Hoffmann", Headcount = 30 },
        new DemoOrgUnit { Id = 6, ParentId = 5, Title = "Design", Lead = "K. Bauer", Headcount = 9 },

        // Parent 99 is not in the list, so this row becomes a root instead of disappearing.
        new DemoOrgUnit { Id = 7, ParentId = 99, Title = "Orphaned unit", Lead = "—", Headcount = 1 },
    ];
}

Cell templates

CellTemplate receives a context carrying the item, the node and its depth, so a template can react to hierarchy. Here the tree column adds a per-kind icon and the size column renders a DwsBadge instead of raw text.

Project files with templated cells
NameDepthSize
src0
Components1
DwsTreeTable.razor2118 KB
DwsTreeTable.razor.cs2642 KB
Styles1
_treetable.scss247 KB
assets0
logo.svg112 KB
screenshot.png1921 KB
README.md08 KB
Show Code
TreeTable.razor
<DwsTreeTable T="DemoFileNode" Name="TreeTableDemo_Templates" Items="@_fileTree" ChildrenSelector="@FileChildren" ItemKeySelector="@FileKey" DefaultExpanded="true" Caption="Project files with templated cells">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Templates_Name" Field="Name" Title="Name" IsTreeColumn="true">
            <CellTemplate>
                @* context is DwsTreeTableCellContext<DemoFileNode>: Item, Node, Depth, IsExpanded, IsSelected *@
                <DwsIcon Name="@($"TreeTableDemo_Templates_Icon_{context.Item.Id}")" Icon="@(context.Item.IsFolder ? Icons.BS.Folder : Icons.BS.FileEarmark)" Color="@(context.Item.IsFolder ? DwsColor.Warning : DwsColor.Info)" Size="DwsSize.Small" Class="me-2" />
                <span>@context.Item.Name</span>
            </CellTemplate>
        </DwsTreeTableColumn>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Templates_Depth" Title="Depth" Alignment="DwsHorizontalAlignment.Center" Width="100">
            <CellTemplate>
                <span>@context.Depth</span>
            </CellTemplate>
        </DwsTreeTableColumn>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Templates_Size" Title="Size" Alignment="DwsHorizontalAlignment.Right" Width="140">
            <CellTemplate>
                @if (context.Item.SizeKb > 0)
                {
                    <DwsBadge Name="@($"TreeTableDemo_Templates_Badge_{context.Item.Id}")" Content="@($"{context.Item.SizeKb} KB")" Color="@(context.Item.SizeKb > 500 ? DwsColor.Error : DwsColor.Success)" />
                }
            </CellTemplate>
        </DwsTreeTableColumn>
    </DwsTreeTableColumns>
</DwsTreeTable>

@code {
    private sealed class DemoFileNode
    {
        public int Id { get; init; }
        public string Name { get; init; } = string.Empty;
        public string Kind { get; init; } = string.Empty;
        public int SizeKb { get; init; }
        public bool IsFolder => Children.Count > 0 || Kind == "Folder";
        public List<DemoFileNode> Children { get; init; } = [];
    }

    private static readonly Func<DemoFileNode, IEnumerable<DemoFileNode>?> FileChildren = node => node.Children;
    private static readonly Func<DemoFileNode, object> FileKey = node => node.Id;

    private readonly List<DemoFileNode> _fileTree =
    [
        new DemoFileNode
        {
            Id = 1, Name = "src", Kind = "Folder",
            Children =
            [
                new DemoFileNode
                {
                    Id = 2, Name = "Components", Kind = "Folder",
                    Children =
                    [
                        new DemoFileNode { Id = 3, Name = "DwsTreeTable.razor", Kind = "Razor", SizeKb = 118 },
                        new DemoFileNode { Id = 4, Name = "DwsTreeTable.razor.cs", Kind = "C#", SizeKb = 642 },
                    ],
                },
                new DemoFileNode
                {
                    Id = 5, Name = "Styles", Kind = "Folder",
                    Children = [new DemoFileNode { Id = 6, Name = "_treetable.scss", Kind = "SCSS", SizeKb = 47 }],
                },
            ],
        },
        new DemoFileNode
        {
            Id = 7, Name = "assets", Kind = "Folder",
            Children =
            [
                new DemoFileNode { Id = 8, Name = "logo.svg", Kind = "Image", SizeKb = 12 },
                new DemoFileNode { Id = 9, Name = "screenshot.png", Kind = "Image", SizeKb = 921 },
            ],
        },
        new DemoFileNode { Id = 10, Name = "README.md", Kind = "Markdown", SizeKb = 8 },
    ];
}

Cycle safety

This example is deliberately fed a cyclic graph: a folder that contains itself. The old implementation recursed until StackOverflowException, which cannot be caught and takes down every circuit on the server. The table now detects the repeat on the current root-to-node path, drops that subtree, reports it through HandleError, and keeps rendering.

Cyclic data, rendered safely
Name
recursive (contains itself)
ordinary-child.txt
mutual-a
mutual-b
Show Code
TreeTable.razor
@* The table tracks the keys on the current root-to-node path. A repeated key means a cycle:
   the subtree is dropped, the problem is reported through HandleError, and rendering continues. *@
<DwsTreeTable T="DemoFileNode" Name="TreeTableDemo_Cycle" Items="@_cyclicTree" ChildrenSelector="@FileChildren" ItemKeySelector="@FileKey" DefaultExpanded="true" Caption="Cyclic data, rendered safely">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Cycle_Name" Field="Name" Title="Name" IsTreeColumn="true" />
    </DwsTreeTableColumns>
</DwsTreeTable>

@code {
    private sealed class DemoFileNode
    {
        public int Id { get; init; }
        public string Name { get; init; } = string.Empty;
        public string Kind { get; init; } = string.Empty;
        public int SizeKb { get; init; }
        public bool IsFolder => Children.Count > 0 || Kind == "Folder";
        public List<DemoFileNode> Children { get; init; } = [];
    }

    private static readonly Func<DemoFileNode, IEnumerable<DemoFileNode>?> FileChildren = node => node.Children;
    private static readonly Func<DemoFileNode, object> FileKey = node => node.Id;

    private readonly List<DemoFileNode> _cyclicTree = BuildCyclicTree();

    // Deliberately cyclic: a folder that contains itself, and two folders that contain each other.
    private static List<DemoFileNode> BuildCyclicTree()
    {
        DemoFileNode selfReferencing = new() { Id = 3000, Name = "recursive (contains itself)", Kind = "Folder" };
        selfReferencing.Children.Add(new DemoFileNode { Id = 3001, Name = "ordinary-child.txt", Kind = "Text", SizeKb = 4 });
        selfReferencing.Children.Add(selfReferencing);

        DemoFileNode mutualA = new() { Id = 3010, Name = "mutual-a", Kind = "Folder" };
        DemoFileNode mutualB = new() { Id = 3011, Name = "mutual-b", Kind = "Folder" };
        mutualA.Children.Add(mutualB);
        mutualB.Children.Add(mutualA);

        return [selfReferencing, mutualA];
    }
}

Per-row styling

RowClass and RowStyle take the item and return a class or inline style, so rows can be styled from their own data. Here anything over 500 KB is tinted.

Rows styled from their own data
NameSize (KB)
src0
Components0
DwsTreeTable.razor118
DwsTreeTable.razor.cs642
Styles0
_treetable.scss47
assets0
logo.svg12
screenshot.png921
README.md8
Show Code
TreeTable.razor
<DwsTreeTable T="DemoFileNode" Name="TreeTableDemo_RowStyling" Items="@_fileTree" ChildrenSelector="@FileChildren" ItemKeySelector="@FileKey" DefaultExpanded="true" RowStyle="@LargeRowStyle" Caption="Rows styled from their own data">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_RowStyling_Name" Field="Name" Title="Name" IsTreeColumn="true" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_RowStyling_Size" Field="SizeKb" Title="Size (KB)" Alignment="DwsHorizontalAlignment.Right" Width="120" />
    </DwsTreeTableColumns>
</DwsTreeTable>

@code {
    private sealed class DemoFileNode
    {
        public int Id { get; init; }
        public string Name { get; init; } = string.Empty;
        public string Kind { get; init; } = string.Empty;
        public int SizeKb { get; init; }
        public bool IsFolder => Children.Count > 0 || Kind == "Folder";
        public List<DemoFileNode> Children { get; init; } = [];
    }

    private static readonly Func<DemoFileNode, IEnumerable<DemoFileNode>?> FileChildren = node => node.Children;
    private static readonly Func<DemoFileNode, object> FileKey = node => node.Id;

    private readonly List<DemoFileNode> _fileTree =
    [
        new DemoFileNode
        {
            Id = 1, Name = "src", Kind = "Folder",
            Children =
            [
                new DemoFileNode
                {
                    Id = 2, Name = "Components", Kind = "Folder",
                    Children =
                    [
                        new DemoFileNode { Id = 3, Name = "DwsTreeTable.razor", Kind = "Razor", SizeKb = 118 },
                        new DemoFileNode { Id = 4, Name = "DwsTreeTable.razor.cs", Kind = "C#", SizeKb = 642 },
                    ],
                },
                new DemoFileNode
                {
                    Id = 5, Name = "Styles", Kind = "Folder",
                    Children = [new DemoFileNode { Id = 6, Name = "_treetable.scss", Kind = "SCSS", SizeKb = 47 }],
                },
            ],
        },
        new DemoFileNode
        {
            Id = 7, Name = "assets", Kind = "Folder",
            Children =
            [
                new DemoFileNode { Id = 8, Name = "logo.svg", Kind = "Image", SizeKb = 12 },
                new DemoFileNode { Id = 9, Name = "screenshot.png", Kind = "Image", SizeKb = 921 },
            ],
        },
        new DemoFileNode { Id = 10, Name = "README.md", Kind = "Markdown", SizeKb = 8 },
    ];

    // RowClass works the same way and returns a CSS class instead.
    private static readonly Func<DemoFileNode, string> LargeRowStyle = node => node.SizeKb > 500 ? "background-color: var(--error-hover);" : string.Empty;
}

Fixed height and sticky header

Height bounds the scroll container and StickyHead pins the header row while the body scrolls.

Scrolling body with a pinned header
NameKind
level-0Folder
level-1Folder
level-2Folder
level-3Folder
level-4Folder
level-5Folder
level-6Folder
leaf-at-6.txtText
leaf-at-5.txtText
leaf-at-4.txtText
leaf-at-3.txtText
leaf-at-2.txtText
leaf-at-1.txtText
Show Code
TreeTable.razor
<DwsTreeTable T="DemoFileNode" Name="TreeTableDemo_Sticky" Items="@_deepTree" ChildrenSelector="@FileChildren" ItemKeySelector="@FileKey" DefaultExpanded="true" StickyHead="true" Height="260" Caption="Scrolling body with a pinned header">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Sticky_Name" Field="Name" Title="Name" IsTreeColumn="true" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Sticky_Kind" Field="Kind" Title="Kind" />
    </DwsTreeTableColumns>
</DwsTreeTable>

@code {
    private sealed class DemoFileNode
    {
        public int Id { get; init; }
        public string Name { get; init; } = string.Empty;
        public string Kind { get; init; } = string.Empty;
        public int SizeKb { get; init; }
        public bool IsFolder => Children.Count > 0 || Kind == "Folder";
        public List<DemoFileNode> Children { get; init; } = [];
    }

    private static readonly Func<DemoFileNode, IEnumerable<DemoFileNode>?> FileChildren = node => node.Children;
    private static readonly Func<DemoFileNode, object> FileKey = node => node.Id;

    private readonly List<DemoFileNode> _deepTree = BuildDeepTree();

    // Six levels deep: each level holds a folder and a leaf file.
    private static List<DemoFileNode> BuildDeepTree()
    {
        DemoFileNode root = new() { Id = 1000, Name = "level-0", Kind = "Folder" };
        DemoFileNode current = root;

        for (int level = 1; level <= 6; level++)
        {
            DemoFileNode child = new() { Id = 1000 + level, Name = $"level-{level}", Kind = "Folder" };
            current.Children.Add(child);
            current.Children.Add(new DemoFileNode { Id = 2000 + level, Name = $"leaf-at-{level}.txt", Kind = "Text", SizeKb = level * 3 });
            current = child;
        }

        return [root];
    }
}

Empty state

With no items the table renders a localized empty-state row.

Default empty state
NameKind
No data available.
Show Code
TreeTable.razor
@* No EmptyStateContent: the table shows its localized empty-state row. *@
<DwsTreeTable T="DemoFileNode" Name="TreeTableDemo_EmptyDefault" Items="@_noItems" ChildrenSelector="@FileChildren" ItemKeySelector="@FileKey" Caption="Default empty state">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_EmptyDefault_Name" Field="Name" Title="Name" IsTreeColumn="true" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_EmptyDefault_Kind" Field="Kind" Title="Kind" />
    </DwsTreeTableColumns>
</DwsTreeTable>

@code {
    private sealed class DemoFileNode
    {
        public int Id { get; init; }
        public string Name { get; init; } = string.Empty;
        public string Kind { get; init; } = string.Empty;
        public int SizeKb { get; init; }
        public bool IsFolder => Children.Count > 0 || Kind == "Folder";
        public List<DemoFileNode> Children { get; init; } = [];
    }

    private static readonly Func<DemoFileNode, IEnumerable<DemoFileNode>?> FileChildren = node => node.Children;
    private static readonly Func<DemoFileNode, object> FileKey = node => node.Id;

    private readonly List<DemoFileNode> _noItems = [];
}

Custom empty state

EmptyStateContent replaces the empty-state row with your own markup.

Custom empty state
NameKind
Nothing here yet
Show Code
TreeTable.razor
<DwsTreeTable T="DemoFileNode" Name="TreeTableDemo_EmptyCustom" Items="@_noItems" ChildrenSelector="@FileChildren" ItemKeySelector="@FileKey" Caption="Custom empty state">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_EmptyCustom_Name" Field="Name" Title="Name" IsTreeColumn="true" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_EmptyCustom_Kind" Field="Kind" Title="Kind" />
    </DwsTreeTableColumns>
    <EmptyStateContent>
        <DwsIcon Name="TreeTableDemo_EmptyCustom_Icon" Icon="@Icons.BS.InboxFill" Color="DwsColor.Secondary" Size="DwsSize.Large" Class="d-block mb-2" />
        <strong>Nothing here yet</strong>
    </EmptyStateContent>
</DwsTreeTable>

@code {
    private sealed class DemoFileNode
    {
        public int Id { get; init; }
        public string Name { get; init; } = string.Empty;
        public string Kind { get; init; } = string.Empty;
        public int SizeKb { get; init; }
        public bool IsFolder => Children.Count > 0 || Kind == "Folder";
        public List<DemoFileNode> Children { get; init; } = [];
    }

    private static readonly Func<DemoFileNode, IEnumerable<DemoFileNode>?> FileChildren = node => node.Children;
    private static readonly Func<DemoFileNode, object> FileKey = node => node.Id;

    private readonly List<DemoFileNode> _noItems = [];
}

Header and cell tooltips

HeaderTooltip explains a column; CellTooltipFunc explains one row's value. Hover a header or a name to see them.

Header and cell tooltips
NameKindSize (KB)
srcFolder0
ComponentsFolder0
DwsTreeTable.razorRazor118
DwsTreeTable.razor.csC#642
StylesFolder0
_treetable.scssSCSS47
assetsFolder0
logo.svgImage12
screenshot.pngImage921
README.mdMarkdown8
Show Code
TreeTable.razor
<DwsTreeTable T="DemoFileNode" Name="TreeTableDemo_Tooltips" Items="@_fileTree" ChildrenSelector="@FileChildren" ItemKeySelector="@FileKey" DefaultExpanded="true" Caption="Header and cell tooltips">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Tooltips_Name" Field="Name" Title="Name" IsTreeColumn="true" HeaderTooltip="The file or folder name." CellTooltipFunc="@FileTooltip" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Tooltips_Kind" Field="Kind" Title="Kind" HeaderTooltip="What the entry is." />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Tooltips_Size" Field="SizeKb" Title="Size (KB)" HeaderTooltip="Rounded to whole kilobytes." Alignment="DwsHorizontalAlignment.Right" Width="120" />
    </DwsTreeTableColumns>
</DwsTreeTable>

@code {
    private sealed class DemoFileNode
    {
        public int Id { get; init; }
        public string Name { get; init; } = string.Empty;
        public string Kind { get; init; } = string.Empty;
        public int SizeKb { get; init; }
        public bool IsFolder => Children.Count > 0 || Kind == "Folder";
        public List<DemoFileNode> Children { get; init; } = [];
    }

    private static readonly Func<DemoFileNode, IEnumerable<DemoFileNode>?> FileChildren = node => node.Children;
    private static readonly Func<DemoFileNode, object> FileKey = node => node.Id;

    private readonly List<DemoFileNode> _fileTree =
    [
        new DemoFileNode
        {
            Id = 1, Name = "src", Kind = "Folder",
            Children =
            [
                new DemoFileNode
                {
                    Id = 2, Name = "Components", Kind = "Folder",
                    Children =
                    [
                        new DemoFileNode { Id = 3, Name = "DwsTreeTable.razor", Kind = "Razor", SizeKb = 118 },
                        new DemoFileNode { Id = 4, Name = "DwsTreeTable.razor.cs", Kind = "C#", SizeKb = 642 },
                    ],
                },
                new DemoFileNode
                {
                    Id = 5, Name = "Styles", Kind = "Folder",
                    Children = [new DemoFileNode { Id = 6, Name = "_treetable.scss", Kind = "SCSS", SizeKb = 47 }],
                },
            ],
        },
        new DemoFileNode
        {
            Id = 7, Name = "assets", Kind = "Folder",
            Children =
            [
                new DemoFileNode { Id = 8, Name = "logo.svg", Kind = "Image", SizeKb = 12 },
                new DemoFileNode { Id = 9, Name = "screenshot.png", Kind = "Image", SizeKb = 921 },
            ],
        },
        new DemoFileNode { Id = 10, Name = "README.md", Kind = "Markdown", SizeKb = 8 },
    ];

    private static readonly Func<DemoFileNode, string> FileTooltip = item => $"{item.Name} - {item.Kind}";
}

Conditional cell badges

BadgeSelector adds a badge beside a cell value and BadgeColorSelector picks its colour. Returning null renders no badge, so a badge can be conditional rather than decoration on every line: here only files over 100 KB are marked.

Large files get a badge
NameKindSize (KB)
srcFolder0
ComponentsFolder0
DwsTreeTable.razorRazorlarge118
DwsTreeTable.razor.csC#large642
StylesFolder0
_treetable.scssSCSS47
assetsFolder0
logo.svgImage12
screenshot.pngImagelarge921
README.mdMarkdown8
Show Code
TreeTable.razor
<DwsTreeTable T="DemoFileNode" Name="TreeTableDemo_Badges" Items="@_fileTree" ChildrenSelector="@FileChildren" ItemKeySelector="@FileKey" DefaultExpanded="true" Caption="Large files get a badge">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Badges_Name" Field="Name" Title="Name" IsTreeColumn="true" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Badges_Kind" Field="Kind" Title="Kind" BadgeSelector="@LargeBadge" BadgeColorSelector="@AlwaysWarning" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Badges_Size" Field="SizeKb" Title="Size (KB)" Alignment="DwsHorizontalAlignment.Right" Width="120" />
    </DwsTreeTableColumns>
</DwsTreeTable>

@code {
    private sealed class DemoFileNode
    {
        public int Id { get; init; }
        public string Name { get; init; } = string.Empty;
        public string Kind { get; init; } = string.Empty;
        public int SizeKb { get; init; }
        public bool IsFolder => Children.Count > 0 || Kind == "Folder";
        public List<DemoFileNode> Children { get; init; } = [];
    }

    private static readonly Func<DemoFileNode, IEnumerable<DemoFileNode>?> FileChildren = node => node.Children;
    private static readonly Func<DemoFileNode, object> FileKey = node => node.Id;

    private readonly List<DemoFileNode> _fileTree =
    [
        new DemoFileNode
        {
            Id = 1, Name = "src", Kind = "Folder",
            Children =
            [
                new DemoFileNode
                {
                    Id = 2, Name = "Components", Kind = "Folder",
                    Children =
                    [
                        new DemoFileNode { Id = 3, Name = "DwsTreeTable.razor", Kind = "Razor", SizeKb = 118 },
                        new DemoFileNode { Id = 4, Name = "DwsTreeTable.razor.cs", Kind = "C#", SizeKb = 642 },
                    ],
                },
                new DemoFileNode
                {
                    Id = 5, Name = "Styles", Kind = "Folder",
                    Children = [new DemoFileNode { Id = 6, Name = "_treetable.scss", Kind = "SCSS", SizeKb = 47 }],
                },
            ],
        },
        new DemoFileNode
        {
            Id = 7, Name = "assets", Kind = "Folder",
            Children =
            [
                new DemoFileNode { Id = 8, Name = "logo.svg", Kind = "Image", SizeKb = 12 },
                new DemoFileNode { Id = 9, Name = "screenshot.png", Kind = "Image", SizeKb = 921 },
            ],
        },
        new DemoFileNode { Id = 10, Name = "README.md", Kind = "Markdown", SizeKb = 8 },
    ];

    // Null renders no badge for that row.
    private string? LargeBadge(DemoFileNode item) => item.SizeKb > 100 ? "large" : null;

    private static readonly Func<DemoFileNode, DwsColor> AlwaysWarning = _ => DwsColor.Warning;
}

Static column styling

HeaderClass, HeaderStyle, CellClass and CellStyle are column-constant, so they are folded into a prefix once per layout change rather than rebuilt per cell. Here the names are semi-bold, the Kind header is upper-case and spaced, and sizes use tabular figures.

Static column styling
NameKindSize (KB)
srcFolder0
ComponentsFolder0
DwsTreeTable.razorRazor118
DwsTreeTable.razor.csC#642
StylesFolder0
_treetable.scssSCSS47
assetsFolder0
logo.svgImage12
screenshot.pngImage921
README.mdMarkdown8
Show Code
TreeTable.razor
<DwsTreeTable T="DemoFileNode" Name="TreeTableDemo_Styling" Items="@_fileTree" ChildrenSelector="@FileChildren" ItemKeySelector="@FileKey" DefaultExpanded="true" Caption="Static column styling">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Styling_Name" Field="Name" Title="Name" IsTreeColumn="true" CellClass="fw-semibold" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Styling_Kind" Field="Kind" Title="Kind" Width="160" HeaderClass="text-uppercase" HeaderStyle="letter-spacing:0.06em;" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Styling_Size" Field="SizeKb" Title="Size (KB)" Width="180" Alignment="DwsHorizontalAlignment.Right" CellStyle="font-variant-numeric:tabular-nums;" />
    </DwsTreeTableColumns>
</DwsTreeTable>

@code {
    private sealed class DemoFileNode
    {
        public int Id { get; init; }
        public string Name { get; init; } = string.Empty;
        public string Kind { get; init; } = string.Empty;
        public int SizeKb { get; init; }
        public bool IsFolder => Children.Count > 0 || Kind == "Folder";
        public List<DemoFileNode> Children { get; init; } = [];
    }

    private static readonly Func<DemoFileNode, IEnumerable<DemoFileNode>?> FileChildren = node => node.Children;
    private static readonly Func<DemoFileNode, object> FileKey = node => node.Id;

    private readonly List<DemoFileNode> _fileTree =
    [
        new DemoFileNode
        {
            Id = 1, Name = "src", Kind = "Folder",
            Children =
            [
                new DemoFileNode
                {
                    Id = 2, Name = "Components", Kind = "Folder",
                    Children =
                    [
                        new DemoFileNode { Id = 3, Name = "DwsTreeTable.razor", Kind = "Razor", SizeKb = 118 },
                        new DemoFileNode { Id = 4, Name = "DwsTreeTable.razor.cs", Kind = "C#", SizeKb = 642 },
                    ],
                },
                new DemoFileNode
                {
                    Id = 5, Name = "Styles", Kind = "Folder",
                    Children = [new DemoFileNode { Id = 6, Name = "_treetable.scss", Kind = "SCSS", SizeKb = 47 }],
                },
            ],
        },
        new DemoFileNode
        {
            Id = 7, Name = "assets", Kind = "Folder",
            Children =
            [
                new DemoFileNode { Id = 8, Name = "logo.svg", Kind = "Image", SizeKb = 12 },
                new DemoFileNode { Id = 9, Name = "screenshot.png", Kind = "Image", SizeKb = 921 },
            ],
        },
        new DemoFileNode { Id = 10, Name = "README.md", Kind = "Markdown", SizeKb = 8 },
    ];
}

Per-row cell styling

CellClassFunc and CellStyleFunc receive the item and run for every rendered cell of that column, so keep them cheap; a thousand-row tree calls them a thousand times per render. Here sizes over 500 KB turn red and bold.

A per-row rule on Size
NameSize (KB)
src0
Components0
DwsTreeTable.razor118
DwsTreeTable.razor.cs642
Styles0
_treetable.scss47
assets0
logo.svg12
screenshot.png921
README.md8
Show Code
TreeTable.razor
<DwsTreeTable T="DemoFileNode" Name="TreeTableDemo_CellFunc" Items="@_fileTree" ChildrenSelector="@FileChildren" ItemKeySelector="@FileKey" DefaultExpanded="true" Caption="A per-row rule on Size">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_CellFunc_Name" Field="Name" Title="Name" IsTreeColumn="true" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_CellFunc_Size" Field="SizeKb" Title="Size (KB)" Width="180" Alignment="DwsHorizontalAlignment.Right" CellClassFunc="@LargeCellClass" CellStyleFunc="@LargeCellStyle" />
    </DwsTreeTableColumns>
</DwsTreeTable>

@code {
    private sealed class DemoFileNode
    {
        public int Id { get; init; }
        public string Name { get; init; } = string.Empty;
        public string Kind { get; init; } = string.Empty;
        public int SizeKb { get; init; }
        public bool IsFolder => Children.Count > 0 || Kind == "Folder";
        public List<DemoFileNode> Children { get; init; } = [];
    }

    private static readonly Func<DemoFileNode, IEnumerable<DemoFileNode>?> FileChildren = node => node.Children;
    private static readonly Func<DemoFileNode, object> FileKey = node => node.Id;

    private readonly List<DemoFileNode> _fileTree =
    [
        new DemoFileNode
        {
            Id = 1, Name = "src", Kind = "Folder",
            Children =
            [
                new DemoFileNode
                {
                    Id = 2, Name = "Components", Kind = "Folder",
                    Children =
                    [
                        new DemoFileNode { Id = 3, Name = "DwsTreeTable.razor", Kind = "Razor", SizeKb = 118 },
                        new DemoFileNode { Id = 4, Name = "DwsTreeTable.razor.cs", Kind = "C#", SizeKb = 642 },
                    ],
                },
                new DemoFileNode
                {
                    Id = 5, Name = "Styles", Kind = "Folder",
                    Children = [new DemoFileNode { Id = 6, Name = "_treetable.scss", Kind = "SCSS", SizeKb = 47 }],
                },
            ],
        },
        new DemoFileNode
        {
            Id = 7, Name = "assets", Kind = "Folder",
            Children =
            [
                new DemoFileNode { Id = 8, Name = "logo.svg", Kind = "Image", SizeKb = 12 },
                new DemoFileNode { Id = 9, Name = "screenshot.png", Kind = "Image", SizeKb = 921 },
            ],
        },
        new DemoFileNode { Id = 10, Name = "README.md", Kind = "Markdown", SizeKb = 8 },
    ];

    // Called for every rendered cell of the column, so keep them cheap.
    private static readonly Func<DemoFileNode, string> LargeCellClass = item => item.SizeKb > 500 ? "color-error" : string.Empty;
    private static readonly Func<DemoFileNode, string> LargeCellStyle = item => item.SizeKb > 500 ? "font-weight:600;" : string.Empty;
}

Header template

HeaderTemplate replaces the header's content entirely when a label is not enough - here an icon in front of the title. The sort control and the resize handle stay outside it.

A templated header
Name Kind
srcFolder
ComponentsFolder
DwsTreeTable.razorRazor
DwsTreeTable.razor.csC#
StylesFolder
_treetable.scssSCSS
assetsFolder
logo.svgImage
screenshot.pngImage
README.mdMarkdown
Show Code
TreeTable.razor
<DwsTreeTable T="DemoFileNode" Name="TreeTableDemo_HeaderTpl" Items="@_fileTree" ChildrenSelector="@FileChildren" ItemKeySelector="@FileKey" DefaultExpanded="true" Caption="A templated header">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_HeaderTpl_Name" Field="Name" Title="Name" IsTreeColumn="true" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_HeaderTpl_Kind" Field="Kind" Title="Kind" Width="160">
            <HeaderTemplate>
                <DwsIcon Name="TreeTableDemo_Styling_KindIcon" Icon="@Icons.BS.Tags" Class="me-1" />
                <span>Kind</span>
            </HeaderTemplate>
        </DwsTreeTableColumn>
    </DwsTreeTableColumns>
</DwsTreeTable>

@code {
    private sealed class DemoFileNode
    {
        public int Id { get; init; }
        public string Name { get; init; } = string.Empty;
        public string Kind { get; init; } = string.Empty;
        public int SizeKb { get; init; }
        public bool IsFolder => Children.Count > 0 || Kind == "Folder";
        public List<DemoFileNode> Children { get; init; } = [];
    }

    private static readonly Func<DemoFileNode, IEnumerable<DemoFileNode>?> FileChildren = node => node.Children;
    private static readonly Func<DemoFileNode, object> FileKey = node => node.Id;

    private readonly List<DemoFileNode> _fileTree =
    [
        new DemoFileNode
        {
            Id = 1, Name = "src", Kind = "Folder",
            Children =
            [
                new DemoFileNode
                {
                    Id = 2, Name = "Components", Kind = "Folder",
                    Children =
                    [
                        new DemoFileNode { Id = 3, Name = "DwsTreeTable.razor", Kind = "Razor", SizeKb = 118 },
                        new DemoFileNode { Id = 4, Name = "DwsTreeTable.razor.cs", Kind = "C#", SizeKb = 642 },
                    ],
                },
                new DemoFileNode
                {
                    Id = 5, Name = "Styles", Kind = "Folder",
                    Children = [new DemoFileNode { Id = 6, Name = "_treetable.scss", Kind = "SCSS", SizeKb = 47 }],
                },
            ],
        },
        new DemoFileNode
        {
            Id = 7, Name = "assets", Kind = "Folder",
            Children =
            [
                new DemoFileNode { Id = 8, Name = "logo.svg", Kind = "Image", SizeKb = 12 },
                new DemoFileNode { Id = 9, Name = "screenshot.png", Kind = "Image", SizeKb = 921 },
            ],
        },
        new DemoFileNode { Id = 10, Name = "README.md", Kind = "Markdown", SizeKb = 8 },
    ];
}

Pinned columns

Pin freezes a column against the horizontal scroll. Left-pinned columns stack in declaration order and the component computes each offset, so you never hand it pixel positions.

Scroll the table sideways to see the pin hold.

Name is pinned left
NameKindSize (KB)
srcFolder0
ComponentsFolder0
DwsTreeTable.razorRazor118
DwsTreeTable.razor.csC#642
StylesFolder0
_treetable.scssSCSS47
assetsFolder0
logo.svgImage12
screenshot.pngImage921
README.mdMarkdown8
Show Code
TreeTable.razor
<p class="mb-2"><small class="text-body-secondary">Scroll the table sideways to see the pin hold.</small></p>

<DwsTreeTable T="DemoFileNode" Name="TreeTableDemo_Pinned" Items="@_fileTree" ChildrenSelector="@FileChildren" ItemKeySelector="@FileKey" DefaultExpanded="true" MinWidth="1100" Caption="Name is pinned left">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Pinned_Name" Field="Name" Title="Name" IsTreeColumn="true" Width="260" Pin="DwsColumnPin.Left" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Pinned_Kind" Field="Kind" Title="Kind" Width="420" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Pinned_Size" Field="SizeKb" Title="Size (KB)" Width="420" Alignment="DwsHorizontalAlignment.Right" />
    </DwsTreeTableColumns>
</DwsTreeTable>

@code {
    private sealed class DemoFileNode
    {
        public int Id { get; init; }
        public string Name { get; init; } = string.Empty;
        public string Kind { get; init; } = string.Empty;
        public int SizeKb { get; init; }
        public bool IsFolder => Children.Count > 0 || Kind == "Folder";
        public List<DemoFileNode> Children { get; init; } = [];
    }

    private static readonly Func<DemoFileNode, IEnumerable<DemoFileNode>?> FileChildren = node => node.Children;
    private static readonly Func<DemoFileNode, object> FileKey = node => node.Id;

    private readonly List<DemoFileNode> _fileTree =
    [
        new DemoFileNode
        {
            Id = 1, Name = "src", Kind = "Folder",
            Children =
            [
                new DemoFileNode
                {
                    Id = 2, Name = "Components", Kind = "Folder",
                    Children =
                    [
                        new DemoFileNode { Id = 3, Name = "DwsTreeTable.razor", Kind = "Razor", SizeKb = 118 },
                        new DemoFileNode { Id = 4, Name = "DwsTreeTable.razor.cs", Kind = "C#", SizeKb = 642 },
                    ],
                },
                new DemoFileNode
                {
                    Id = 5, Name = "Styles", Kind = "Folder",
                    Children = [new DemoFileNode { Id = 6, Name = "_treetable.scss", Kind = "SCSS", SizeKb = 47 }],
                },
            ],
        },
        new DemoFileNode
        {
            Id = 7, Name = "assets", Kind = "Folder",
            Children =
            [
                new DemoFileNode { Id = 8, Name = "logo.svg", Kind = "Image", SizeKb = 12 },
                new DemoFileNode { Id = 9, Name = "screenshot.png", Kind = "Image", SizeKb = 921 },
            ],
        },
        new DemoFileNode { Id = 10, Name = "README.md", Kind = "Markdown", SizeKb = 8 },
    ];
}

Responsive columns

VisibilityBreakpoint drops a column below a viewport width, which is how a wide table degrades on a phone without a second markup path. The filter row follows the same rule. Size disappears below MD, Id below LG.

Narrow the window to drop the breakpoint columns.

Columns that drop on narrow screens
NameKindSize (KB)Id
srcFolder01
ComponentsFolder02
DwsTreeTable.razorRazor1183
DwsTreeTable.razor.csC#6424
StylesFolder05
_treetable.scssSCSS476
assetsFolder07
logo.svgImage128
screenshot.pngImage9219
README.mdMarkdown810
Show Code
TreeTable.razor
<p class="mb-2"><small class="text-body-secondary">Narrow the window to drop the breakpoint columns.</small></p>

<DwsTreeTable T="DemoFileNode" Name="TreeTableDemo_Breakpoint" Items="@_fileTree" ChildrenSelector="@FileChildren" ItemKeySelector="@FileKey" DefaultExpanded="true" Caption="Columns that drop on narrow screens">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Breakpoint_Name" Field="Name" Title="Name" IsTreeColumn="true" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Breakpoint_Kind" Field="Kind" Title="Kind" Width="160" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Breakpoint_Size" Field="SizeKb" Title="Size (KB)" Width="140" Alignment="DwsHorizontalAlignment.Right" VisibilityBreakpoint="DwsVisibilityBreakpoint.MD" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_Breakpoint_Id" Field="Id" Title="Id" Width="100" VisibilityBreakpoint="DwsVisibilityBreakpoint.LG" />
    </DwsTreeTableColumns>
</DwsTreeTable>

@code {
    private sealed class DemoFileNode
    {
        public int Id { get; init; }
        public string Name { get; init; } = string.Empty;
        public string Kind { get; init; } = string.Empty;
        public int SizeKb { get; init; }
        public bool IsFolder => Children.Count > 0 || Kind == "Folder";
        public List<DemoFileNode> Children { get; init; } = [];
    }

    private static readonly Func<DemoFileNode, IEnumerable<DemoFileNode>?> FileChildren = node => node.Children;
    private static readonly Func<DemoFileNode, object> FileKey = node => node.Id;

    private readonly List<DemoFileNode> _fileTree =
    [
        new DemoFileNode
        {
            Id = 1, Name = "src", Kind = "Folder",
            Children =
            [
                new DemoFileNode
                {
                    Id = 2, Name = "Components", Kind = "Folder",
                    Children =
                    [
                        new DemoFileNode { Id = 3, Name = "DwsTreeTable.razor", Kind = "Razor", SizeKb = 118 },
                        new DemoFileNode { Id = 4, Name = "DwsTreeTable.razor.cs", Kind = "C#", SizeKb = 642 },
                    ],
                },
                new DemoFileNode
                {
                    Id = 5, Name = "Styles", Kind = "Folder",
                    Children = [new DemoFileNode { Id = 6, Name = "_treetable.scss", Kind = "SCSS", SizeKb = 47 }],
                },
            ],
        },
        new DemoFileNode
        {
            Id = 7, Name = "assets", Kind = "Folder",
            Children =
            [
                new DemoFileNode { Id = 8, Name = "logo.svg", Kind = "Image", SizeKb = 12 },
                new DemoFileNode { Id = 9, Name = "screenshot.png", Kind = "Image", SizeKb = 921 },
            ],
        },
        new DemoFileNode { Id = 10, Name = "README.md", Kind = "Markdown", SizeKb = 8 },
    ];
}

Cell text that cannot be selected

TextSelectable='false' stops a column's cell text being selected with the mouse, which is what you want on a column whose rows are drag handles. Try to select a name, then a kind.

Names cannot be selected as text
NameKind
srcFolder
ComponentsFolder
DwsTreeTable.razorRazor
DwsTreeTable.razor.csC#
StylesFolder
_treetable.scssSCSS
assetsFolder
logo.svgImage
screenshot.pngImage
README.mdMarkdown
Show Code
TreeTable.razor
<DwsTreeTable T="DemoFileNode" Name="TreeTableDemo_TextSel" Items="@_fileTree" ChildrenSelector="@FileChildren" ItemKeySelector="@FileKey" DefaultExpanded="true" Caption="Names cannot be selected as text">
    <DwsTreeTableColumns>
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_TextSel_Name" Field="Name" Title="Name" IsTreeColumn="true" TextSelectable="false" />
        <DwsTreeTableColumn T="DemoFileNode" Name="TreeTableDemo_TextSel_Kind" Field="Kind" Title="Kind" />
    </DwsTreeTableColumns>
</DwsTreeTable>

@code {
    private sealed class DemoFileNode
    {
        public int Id { get; init; }
        public string Name { get; init; } = string.Empty;
        public string Kind { get; init; } = string.Empty;
        public int SizeKb { get; init; }
        public bool IsFolder => Children.Count > 0 || Kind == "Folder";
        public List<DemoFileNode> Children { get; init; } = [];
    }

    private static readonly Func<DemoFileNode, IEnumerable<DemoFileNode>?> FileChildren = node => node.Children;
    private static readonly Func<DemoFileNode, object> FileKey = node => node.Id;

    private readonly List<DemoFileNode> _fileTree =
    [
        new DemoFileNode
        {
            Id = 1, Name = "src", Kind = "Folder",
            Children =
            [
                new DemoFileNode
                {
                    Id = 2, Name = "Components", Kind = "Folder",
                    Children =
                    [
                        new DemoFileNode { Id = 3, Name = "DwsTreeTable.razor", Kind = "Razor", SizeKb = 118 },
                        new DemoFileNode { Id = 4, Name = "DwsTreeTable.razor.cs", Kind = "C#", SizeKb = 642 },
                    ],
                },
                new DemoFileNode
                {
                    Id = 5, Name = "Styles", Kind = "Folder",
                    Children = [new DemoFileNode { Id = 6, Name = "_treetable.scss", Kind = "SCSS", SizeKb = 47 }],
                },
            ],
        },
        new DemoFileNode
        {
            Id = 7, Name = "assets", Kind = "Folder",
            Children =
            [
                new DemoFileNode { Id = 8, Name = "logo.svg", Kind = "Image", SizeKb = 12 },
                new DemoFileNode { Id = 9, Name = "screenshot.png", Kind = "Image", SizeKb = 921 },
            ],
        },
        new DemoFileNode { Id = 10, Name = "README.md", Kind = "Markdown", SizeKb = 8 },
    ];
}

Interface-Description

Name Typ Default Description
VisibleNodes IReadOnlyList<DwsTreeTableNode<T>> [] The flattened rows currently rendered: every root plus the descendants of every expanded node.
RootNodes IReadOnlyList<DwsTreeTableNode<T>> [] The materialised roots with their full subtrees, after cycle and depth pruning.
SelectedItems IReadOnlyList<T> [] The selected items, in visible-row order.
SelectedNodes IReadOnlyList<DwsTreeTableNode<T>> [] The selected nodes, which carry Depth and Parent.
HasAnyActiveFilter bool false Whether anything is currently narrowing the data.
FilteredMatchCount int 0 How many rows survive the current filter.
SearchMatches IReadOnlyList<DwsTreeTableNode<T>> [] Nodes matching the current search text.
DwsTreeTableColumn.Sortable bool false Whether the header offers a sort control.
DwsTreeTableColumn.SortSelector Func<T, object?>? null Produces the value this column sorts by, skipping reflection.
DwsTreeTableColumn.Comparer IComparer<T>? null Full control over this column's ordering.
DwsTreeTableColumn.ColumnFilterable bool true Whether this column takes part in the filter row.
DwsTreeTableColumn.FilterType DwsColumnFilterType Text Which filter editor the filter row shows.
DwsTreeTableColumn.FilterOptions List<string>? null Choices offered by a MultiSelect filter. Derived from the distinct values in the tree when left null.
DwsTreeTableColumn.FilterValueSelector Func<T, object?>? null Produces the value this column filters on.
DwsTreeTableColumn.FilterPredicateFunc Func<T, string, bool>? null Full control over this column's matching.
DwsTreeTableColumn.Field string string.Empty Property on T this column displays, used for default cell rendering and as the column's identity.
DwsTreeTableColumn.Title string string.Empty Header text. Falls back to Field.
DwsTreeTableColumn.IsTreeColumn bool false Marks the column that hosts the expander and indentation. When no column opts in, the first visible column is promoted.
DwsTreeTableColumn.CellTemplate RenderFragment<DwsTreeTableCellContext<T>>? null Custom cell rendering. Takes precedence over Field.
DwsTreeTableColumn.HeaderTemplate RenderFragment? null Custom header rendering. Takes precedence over Title.
DwsTreeTableColumn.Hidden bool false Hides the column without removing it from the markup.
DwsTreeTableColumn.Alignment DwsHorizontalAlignment Left Horizontal alignment of header and cells.
DwsTreeTableColumn.Width int? null Fixed column width in pixels.
DwsTreeTableColumn.MinWidth int? null Minimum column width in pixels.
DwsTreeTableColumn.MaxWidth int? null Maximum column width in pixels.
DwsTreeTableColumn.CellClass string string.Empty Static CSS class for every cell in the column.
DwsTreeTableColumn.CellClassFunc Func<T, string>? null Per-item CSS class for the column's cells.
DwsTreeTableColumn.CellStyle string string.Empty Static inline style for every cell in the column.
DwsTreeTableColumn.CellStyleFunc Func<T, string>? null Per-item inline style for the column's cells.
DwsTreeTableColumn.HeaderClass string string.Empty Static CSS class for the header cell.
DwsTreeTableColumn.HeaderStyle string string.Empty Static inline style for the header cell.
DwsTreeTableNode.Item T default! The consumer's item at this position.
DwsTreeTableNode.Key object default! Stable identity, from ItemKeySelector.
DwsTreeTableNode.Depth int 0 Zero-based depth; roots are 0.
DwsTreeTableNode.Parent DwsTreeTableNode<T>? null Parent node, or null for a root.
DwsTreeTableNode.Children List<DwsTreeTableNode<T>> [] Child nodes.
DwsTreeTableNode.IsExpanded bool false Whether this node's children are shown.
DwsTreeTableNode.IsExpandable bool false Whether the node can be expanded.
DwsTreeTableNode.IsLeaf bool false Whether the node has no children and none pending.
DwsTreeTableNode.PositionInSet int 0 One-based position among siblings, for aria-posinset.
DwsTreeTableNode.SetSize int 0 Number of siblings at this level, for aria-setsize.
DwsTreeTableColumn.Resizable bool true Whether this column takes part in ColumnResizing.
DwsTreeTableColumn.Reorderable bool true Whether this column takes part in ColumnReordering.
DwsTreeTableColumn.Pin DwsColumnPin None Pins the column to the left or right edge.
DwsTreeTableColumn.VisibilityBreakpoint DwsVisibilityBreakpoint None Hides the column below this viewport width.
DwsTreeTableColumn.TextSelectable bool false Allows text selection inside the column's cells, which is otherwise suppressed so row selection drags cleanly.
DwsTreeTableColumn.DisableTooltip bool false Suppresses the automatic truncation tooltip for this column.
DwsTreeTableColumn.HeaderTooltip string string.Empty Tooltip on the header cell.
DwsTreeTableColumn.CellTooltipFunc Func<T, string>? null Per-item tooltip for the column's cells.
DwsTreeTableColumn.BadgeSelector Func<T, string?>? null Badge text per item. Returning null or an empty string renders no badge for that row.
DwsTreeTableColumn.BadgeColorSelector Func<T, DwsColor>? null Badge colour per item. Defaults to Info.
CurrentEditContext EditContext? null The EditContext of the row being edited, with a DataAnnotationsValidator attached, or null when nothing is being edited.
IsAnyRowEditing bool false Whether a row is currently in edit mode.
DwsTreeTableColumn.Editable bool false Whether this column is edited inline.
DwsTreeTableColumn.EditTemplate RenderFragment<DwsTreeTableCellContext<T>>? null Custom editor for the column. Without it an editable column gets a plain text input bound to Field.
DwsTreeTableNode.IsGroup bool false Whether this is a synthetic heading rather than one of your items. Its Item is default(T).
DwsTreeTableNode.GroupValue object? null What GroupBySelector returned for this group.
DwsTreeTableNode.GroupLabel string string.Empty The heading text.
DwsTreeTableNode.IsLoading bool false Whether a lazy load is in flight for this node.
DwsTreeTableNode.HasUnloadedChildren bool false Whether HasChildrenSelector says there are children that have not been fetched.
DwsTreeTableNode.IsFilterAncestor bool false Whether the node is retained only as the path to a descendant match, in which case it renders dimmed.
Name Typ Parameters Description
ToggleNodeAsync Task Expands or collapses the given node and refreshes the visible-row list.
ExpandNodeAsync Task Expands the given node. No-op when it is already expanded or cannot expand.
CollapseNodeAsync Task Collapses the given node.
ExpandSubtreeAsync Task Expands the node and every descendant, re-flattening once.
CollapseSubtreeAsync Task Collapses the node and every descendant.
ExpandAllAsync Task Expands every expandable node.
CollapseAllAsync Task Collapses every node.
ExpandToAsync Task<DwsTreeTableNode<T>?> Expands every ancestor of the node with the given key so it becomes visible, and returns it.
GetExpandedKeys IReadOnlyCollection<object> A snapshot of the expanded keys, for persistence.
SetExpandedKeysAsync Task Restores an expansion snapshot. Keys that no longer exist are ignored.
FindNode DwsTreeTableNode<T>? Finds a materialised node by its key.
SetSelectedAsync Task Selects or deselects a node, cascading when SelectionMode says to.
ToggleSelectionAsync Task Flips a node's selection. A mixed parent fills in rather than clearing.
SelectRangeAsync Task Selects every visible row between two keys. Falls back to single-select when either key is not visible.
SelectAllVisibleAsync Task Selects every currently visible selectable row.
ClearSelectionAsync Task Clears the whole selection.
GetCheckState bool? True selected, false not, null mixed. Derived from descendants, never stored.
CanSelectNode bool Whether the given node may be selected at all.
IsExpanded bool Whether the node for the given item is currently expanded.
IsSelected bool Whether the given node or item is currently selected.
ToggleColumnSortAsync Task Cycles a column through ascending, descending and unsorted.
SetSortDefinitionsAsync Task Replaces the sort wholesale.
GetSortDirection DwsSortDirection The current sort direction for a column key.
GetSortPriority int A column's 1-based place in a multi-column sort, or 0.
SetColumnFilterAsync Task Sets a column's text filter.
ClearColumnFilterAsync Task Clears one column's filter.
ClearAllFiltersAsync Task Clears every column filter.
FindNodes IReadOnlyList<DwsTreeTableNode<T>> Every node whose item satisfies a predicate.
RevealNodeAsync Task Expands a node's ancestors and moves focus to it.
GoToNextMatchAsync Task Moves to the next search match, wrapping.
GoToPreviousMatchAsync Task Moves to the previous search match, wrapping.
IsColumnVisible bool Whether the column with this key is currently shown.
ToggleColumnVisibilityAsync Task Shows or hides a column by key. Refuses to hide the tree column.
SetColumnOrderAsync Task Reorders the columns from a sequence of column keys. Unlisted columns keep their relative order at the end.
SetColumnWidthAsync Task Sets a column's width in pixels, clamped to its MinWidth and MaxWidth.
ResetColumnLayoutAsync Task Clears widths, order and visibility back to the declared markup.
IsEditing bool Whether this node is the one being edited.
CanEditNode bool Whether this node may be edited, taking EnableRowEditing and CanEdit into account.
StartRowEditAsync Task Opens the editor on a node, unless another row is already open or OnRowEditing refuses.
SaveRowEditAsync Task Validates and commits the open editor. Leaves it open when validation or OnRowSaving refuses.
CancelRowEditAsync Task Abandons the open editor and restores the values captured when it opened.
DeleteRowAsync Task Raises OnRowDeleted for an item. Does not touch your collection.
ToggleGroupAsync Task Expands or collapses a group heading.
EnsureChildrenLoadedAsync Task Runs the lazy loader for a node without expanding it.
LoadMoreChildrenAsync Task Fetches the next page of a node's children (ChildrenPageLoader), as its "Load more" row does. The node tells how far it is: HasMoreChildren, LoadedChildCount, TotalChildCount, IsLoadingMore.
GetPath IReadOnlyList<DwsTreeTableNode<T>> Root to node inclusive.
GetParent DwsTreeTableNode<T>? The parent of a key, or null for a root or an unknown key.
IsSearchMatch bool Whether this node matched the current search text.
GetAncestors IReadOnlyList<DwsTreeTableNode<T>> Parent up to root.
GetDescendants IReadOnlyList<DwsTreeTableNode<T>> Every descendant depth-first, cycle-guarded.
GetDepth int Zero-based depth of a key, or -1 when it is not in the tree.
RevealNodeAsync Task Expands the ancestors of a key and focuses its row.
DwsTreeTableNode.Ancestors IEnumerable<DwsTreeTableNode<T>> Walks parent to root.
DwsTreeTableNode.PathFromRoot IReadOnlyList<DwsTreeTableNode<T>> Root to this node inclusive.
DwsTreeTableNode.Descendants IEnumerable<DwsTreeTableNode<T>> Depth-first descendants, cycle-guarded.
Name Typ Default Description
Items IEnumerable<T> [] Source items. With ChildrenSelector these are the roots; with ParentKeySelector this is the full flat list and roots are inferred.
ChildrenSelector Func<T, IEnumerable<T>?>? null Returns an item's children, for an already-nested model. Mutually exclusive with ParentKeySelector.
ParentKeySelector Func<T, object?>? null Returns an item's parent key, for a flat self-referencing list. Requires ItemKeySelector. Mutually exclusive with ChildrenSelector.
ItemKeySelector Func<T, object>? null Stable identity for an item. Expansion and selection are keyed off this so state survives a data refresh. Required when ParentKeySelector is used.
DwsTreeTableColumns RenderFragment? null The column definitions. Supply DwsTreeTableColumn<T> elements.
MaxDepth int? null Hard cap on hierarchy depth. Deeper nodes are not materialised and a localized notice is shown. Null means unlimited; the cycle guard still applies.
DefaultExpanded bool false Whether the root rows start expanded. Roots only: their children are shown, deeper levels stay collapsed - use ExpandAllAsync(), ExpandSubtreeAsync(node) or ExpandedKeys for more. Applied once, so a later rebuild does not re-expand roots the user collapsed.
Dense bool false Compact row padding.
Striped bool false Alternating row background.
Bordered bool true Outer border around the table.
Hoverable bool true Row highlight on pointer hover.
IndentSize int 20 Indentation per depth level, in pixels. Drives a CSS custom property rather than per-row inline padding.
StickyHead bool false Pins the header row while the body scrolls.
Caption string string.Empty Accessible caption, rendered visually hidden. Strongly recommended for screen readers.
Width int? null Explicit table width in pixels.
Height int? null Explicit table height in pixels. Combine with StickyHead to scroll the body.
MinWidth int? null Minimum table width in pixels.
MaxHeight int? null Maximum table height in pixels.
EmptyStateContent RenderFragment? null Shown instead of rows when there is no data.
RowClass Func<T, string>? null Per-item CSS class for the row element.
RowStyle Func<T, string>? null Per-item inline style for the row element.
DataVersion int 0 Increment to force a rebuild after mutating the Items collection in place, which does not change its reference.
Selectable bool false Master switch for row selection.
MultiSelect bool false Allows more than one row to be selected. Also sets aria-multiselectable.
Deselectable bool false Lets a plain click on the only selected row clear the selection.
SelectionMode DwsTreeTableSelectionMode Independent Cascade makes selecting a row select its subtree, and parents show a derived mixed state.
ShowSelectionCheckbox bool false Renders a checkbox in the tree column for each selectable row.
ShowSelectAll bool false Renders a select-all checkbox in the tree column header, scoped to the visible rows.
CanSelect Func<DwsTreeTableNode<T>, bool>? null Per-node opt-out from selection.
SelectedKeys IReadOnlyList<object> [] The selected rows' keys. Two-way bindable.
KeyboardNavigation bool false Gives the table a single tab stop and enables arrow-key navigation over the rows.
DwsTreeTableColumn.Field string (empty) The item property this column reads, by name. Resolved once per (item type, field) and cached, so it is not a reflection call per cell. Ignored when CellTemplate is set.
DwsTreeTableColumn.Title string (empty) The header label. Falls back to Field when empty.
DwsTreeTableColumn.IsTreeColumn bool false Marks the column that carries the expander and the indentation. With none set, the first visible column is promoted - which also makes it the haystack for SearchText.
DwsTreeTableColumn.CellTemplate RenderFragment<DwsTreeTableCellContext<T>>? null Replaces the cell's content. The context carries the node, the item, the depth and the owning table, so a template can read the hierarchy and call the public expand/select API.
DwsTreeTableColumn.HeaderTemplate RenderFragment? null Replaces the header cell's content. The sort affordance and resize handle stay outside it.
DwsTreeTableColumn.Hidden bool false Hides the column outright. This is the author's switch and it wins over the user's visibility panel, which is why a Hidden column is not offered there at all.
DwsTreeTableColumn.Alignment DwsHorizontalAlignment Left Horizontal alignment of the cell content.
DwsTreeTableColumn.Width int? null Fixed width in pixels, rendered on a <col> so a resize re-renders one element rather than one inline style per cell.
DwsTreeTableColumn.MinWidth int? null Lower bound for both dragging and keyboard resizing.
DwsTreeTableColumn.MaxWidth int? null Upper bound for both dragging and keyboard resizing. Also what the End key resizes to.
DwsTreeTableColumn.CellClass string (empty) Column-constant CSS classes for every cell. Folded into a prefix once per layout change rather than rebuilt per cell.
DwsTreeTableColumn.CellClassFunc Func<T, string>? null Per-row CSS classes. Runs for every rendered cell of the column, so keep it cheap.
DwsTreeTableColumn.CellStyle string (empty) Column-constant inline style for every cell. Prefixed like CellClass.
DwsTreeTableColumn.CellStyleFunc Func<T, string>? null Per-row inline style. Same cost model as CellClassFunc.
DwsTreeTableColumn.HeaderClass string (empty) CSS classes for the header cell.
DwsTreeTableColumn.HeaderStyle string (empty) Inline style for the header cell.
DwsTreeTableColumn.Sortable bool false Lets the header sort this column. Sorting is per-subtree: siblings are ordered within their parent, so the hierarchy survives.
DwsTreeTableColumn.SortSelector Func<T, object?>? null The value to sort by when it is not the displayed field.
DwsTreeTableColumn.Comparer IComparer<T>? null Takes over ordering for this column outright - for values that do not order as text or number, such as a domain-specific sequence.
DwsTreeTableColumn.ColumnFilterable bool true Whether the column gets an editor in the filter row. False leaves the cell in the row empty while the column itself stays visible.
DwsTreeTableColumn.FilterType DwsColumnFilterType Text Text, NumericRange, DateRange or MultiSelect. Decides which editor the filter row renders and which matcher runs.
DwsTreeTableColumn.FilterOptions List<string>? null The choices a MultiSelect filter offers. Without it the component derives them from every node in the tree, so narrowing the filter never removes the option that would widen it again.
DwsTreeTableColumn.FilterValueSelector Func<T, object?>? null The value a filter matches against when that is not the displayed text.
DwsTreeTableColumn.FilterPredicateFunc Func<T, string, bool>? null Replaces the matching rule entirely. Receives the item and the raw filter text.
DwsTreeTableColumn.Resizable bool true Whether this column may be resized, when ColumnResizing is on. The handle is focusable and the arrow keys move it, so this is not a pointer-only affordance.
DwsTreeTableColumn.Reorderable bool false or true Whether this column may be dragged to a new position, when ColumnReordering is on. Defaults to true; the tree column is always refused.
DwsTreeTableColumn.Pin DwsColumnPin None Freezes the column against horizontal scroll. Left-pinned columns stack in declaration order and their offsets are computed, not configured.
DwsTreeTableColumn.VisibilityBreakpoint DwsVisibilityBreakpoint XS Drops the column below this viewport width. The filter row follows the same rule, so a hidden column does not leave a stranded filter behind.
DwsTreeTableColumn.TextSelectable bool true Whether the cell text can be selected with the mouse. Turn it off on a column whose rows are drag handles.
DwsTreeTableColumn.DisableTooltip bool false Suppresses the automatic cell tooltip for this column.
DwsTreeTableColumn.HeaderTooltip string (empty) Tooltip for the header cell.
DwsTreeTableColumn.CellTooltipFunc Func<T, string>? null Per-row tooltip for the cell.
DwsTreeTableColumn.Editable bool false Whether this column's value can be edited inline, when EnableRowEditing is on.
DwsTreeTableColumn.EditTemplate RenderFragment<DwsTreeTableCellContext<T>>? null Replaces the editor this cell shows while its row is being edited. The template owns the binding, so any control the value round-trips through will do.
DwsTreeTableColumn.BadgeSelector Func<T, string?>? null Renders a badge beside the cell value when it returns text.
DwsTreeTableColumn.BadgeColorSelector Func<T, DwsColor>? null The badge's colour, per item.
ExpandedKeys IReadOnlyCollection<object>? null The keys of the expanded rows. Supports two-way binding via @bind-ExpandedKeys. Null leaves the expansion to the table (DefaultExpanded, persisted state, the user). A value is adopted when its content changes; keys of rows that do not exist are ignored.
ActiveSortDefinitions List<DwsSortDefinition> [] The active sort. Deep-copied internally, so the table never mutates the list you pass.
MultiColumnSort bool false Allows sorting by several columns, with priority given by list order.
ShowColumnFilterRow bool false Renders a row of per-column filter editors beneath the header.
FilterPredicate Func<T, bool>? null A global filter, combined with the column filters by AND.
FilterDebounceMs int 200 How long to wait after the last keystroke before re-filtering.
SearchText string? null Free-text search across the rows. Two-way bindable.
SearchSelector Func<T, string>? null What a row is searched against. Falls back to the tree column's field.
SearchMode DwsTreeTableSearchMode Highlight Whether non-matching rows are merely un-highlighted, or hidden.
AutoExpandToMatches bool true Whether the ancestors of a match are expanded automatically.
NodeVisible Func<DwsTreeTableNode<T>, bool>? null Hides individual rows. Hiding a node also hides its subtree.
ColumnResizing bool false Adds a drag grip to each resizable header. Widths are written to the colgroup, so a resize does not re-render the cells.
ColumnReordering bool false Lets headers be dragged into a new order. The tree column stays first, because it hosts the expander.
ShowColumnVisibilityToggle bool false Renders a column picker above the table. The tree column cannot be hidden.
ColumnOrder IReadOnlyList<string>? null Controlled column order, as column keys. A column key is its Field, or its Name when it has no Field.
EnableRowEditing bool false Turns on inline editing. One row is editable at a time and it keeps its place in the tree.
CanEdit Func<DwsTreeTableNode<T>, bool>? null Decides per node whether it may be edited. Nodes that refuse get no edit control.
ShowRowActions bool false Adds a trailing actions cell to every row. It is excluded from keyboard cell navigation.
RowActionsTemplate RenderFragment<DwsTreeTableCellContext<T>>? null Extra controls in the actions cell, rendered after the built-in edit buttons.
EnableContextMenu bool false Opens the row menu, a composed DwsContextMenu: right-click, a long press on a touch screen, or the context menu key / Shift+F10 on a focused row. Arrow keys, Escape and an outside click are the menu's own. (ContextMenuTemplate was removed in 0.1.5.)
ContextMenuItems List<DwsTreeTableContextMenuItem<T>> [] The menu entries. Each can hide itself (IsVisible), disable itself (IsDisabled) or be a separator.
SelectOnContextMenu bool false Selects the row the menu was opened on, so the menu and the selection agree.
ShowBulkActionBar bool false Shows a toolbar above the table while rows are selected, reporting the count.
BulkActions List<DwsTreeTableBulkAction<T>> [] Actions offered in the bulk bar. Each receives the selected nodes, and IsDisabled is evaluated against the whole selection.
ChildrenLoader Func<DwsTreeTableNode<T>, Task<IEnumerable<T>>>? null Fetches a node's children the first time it is expanded. Runs once per node; concurrent expands share the one in-flight load.
ChildrenPageLoader Func<DwsTreeTableNode<T>, int, int, Task<DwsTreeTableChildrenPage<T>>>? null Loads a node's children page by page: node, skip, take -> the items and the node's total (DwsTreeTableChildrenPage<T>). Called on the first expansion and for every "Load more"; the node ends with a row "Load more (n of total)" while there is more. Takes the place of ChildrenLoader when both are set. Sorting, search, filters and "select all" cover the loaded rows.
ChildrenPageSize int 50 How many children ChildrenPageLoader is asked for at a time. Values below 1 count as 1.
ShowPartialChildrenNotice bool true While a node's children are only partly loaded and the table is sorted, searched, filtered or offers "select all", a note under the table says that these cover the loaded rows only.
HasChildrenSelector Func<T, bool>? null Marks an item as expandable before its children exist. Without it an unloaded node is indistinguishable from a leaf.
EnableNodeDragDrop bool false Makes rows draggable and exposes before/inside/after drop strips on each row, so the browser does the hit-testing.
CanDrag Func<DwsTreeTableNode<T>, bool>? null Decides per node whether it may be picked up.
CanAcceptDrop Func<DwsTreeTableNode<T>, bool>? null Decides per node whether it may receive a drop. A node's own subtree is always refused regardless.
HighlightPathToKey object? null Marks every row from the root down to this key, for pointing at one node in a deep tree.
ShowBreadcrumbs bool false Shows the path to the focused node above the table.
BreadcrumbTemplate RenderFragment<DwsTreeTableNode<T>>? null Custom rendering for one breadcrumb step.
AnimateExpansion bool false Transitions rows in as their parent expands. Pure CSS, and suppressed under prefers-reduced-motion.
ExpansionAnimationSpeed DwsAnimationSpeed Normal How fast that transition runs.
EnableVirtualization bool false Virtualizes the flattened visible rows once there are more than VirtualizationThreshold of them.
VirtualizationItemSize float? null Row height in pixels used to size the spacers.
VirtualizationThreshold int 100 Row count below which virtualization stays off, because the spacers would cost more than they save.
OverscanCount int 3 Extra rows rendered beyond the viewport.
PersistState bool false Saves expansion, sort and column layout to local storage and restores them after the first render.
StorageKey string? null Storage key for persisted state. Defaults to the component's Name.
PersistedState DwsTreeTablePersistedState Expansion Which parts are persisted. Selection and filter text are deliberately excluded.
SyncGroup string? null Mirrors state between tables sharing this group name. Scoped per circuit.
SyncScope DwsTreeTableSyncScope Expansion Which state this table mirrors with its sync group.
ChildCountBadge bool false Shows how many children a collapsed node hides, on the tree column.
GroupBySelector Func<T, object?>? null Buckets the ROOTS under synthetic heading rows keyed by this value. Each root keeps its subtree and moves one level down.
GroupHeaderSelector Func<object?, string>? null Heading text for a group. Defaults to the value's ToString(), or a localized "Ungrouped" for null.
GroupHeaderTemplate RenderFragment<DwsTreeTableNode<T>>? null Replaces the heading cell's content. Receives the group node.
DefaultGroupsExpanded bool true Whether groups start expanded. Applied once, like DefaultExpanded.
Name Typ Description
OnNodeToggled EventCallback<DwsTreeTableNode<T>> Raised after a node is expanded or collapsed. Bulk operations raise it once for the whole operation.
ExpandedKeysChanged EventCallback<IReadOnlyCollection<object>> Raised with the new set of expanded keys whenever it changes: a toggled row, expand / collapse all, a restored or synchronised state. Used by @bind-ExpandedKeys.
SelectedKeysChanged EventCallback<IReadOnlyList<object>> Raised whenever the selection changes.
SelectedItemsChanged EventCallback<IReadOnlyList<T>> Raised whenever the selection changes, with the items.
OnClickRow EventCallback<DwsTreeTableNode<T>> Raised on a single click on a row.
OnDblClickRow EventCallback<DwsTreeTableNode<T>> Raised on a double click on a row.
OnRowActivate EventCallback<DwsTreeTableNode<T>> Raised when a row is activated by Enter or a double click.
OnSortChanged EventCallback<List<DwsSortDefinition>> Raised whenever the sort changes.
OnColumnFilterChanged EventCallback<DwsTreeTableColumn<T>> Raised when a column's filter value changes.
OnFiltersCleared EventCallback Raised when every filter has been cleared.
OnSearchMatchesChanged EventCallback<IReadOnlyList<DwsTreeTableNode<T>>> Raised when the match set changes.
OnColumnOrderChanged EventCallback<IReadOnlyList<string>> Raised with the new column key order after a reorder.
OnColumnResized EventCallback<(string ColumnKey, int Width)> Raised when a column's width changes, by drag or by SetColumnWidthAsync.
OnColumnVisibilityChanged EventCallback<IReadOnlyList<string>> Raised with the keys of the columns that are now visible, in render order.
OnRowEditing EventCallback<DwsTreeTableRowEditArgs<T>> Raised before an edit starts. Set args.Cancel to refuse.
OnRowSaving EventCallback<DwsTreeTableRowEditArgs<T>> Raised after validation passes and before the edit closes. Set args.Cancel to keep the editor open.
OnRowSaved EventCallback<T> Raised once an edit has been committed.
OnRowEditCancelled EventCallback<T> Raised after an edit was abandoned and the snapshot restored.
OnRowDeleted EventCallback<T> Raised by DeleteRowAsync. The table never removes the item itself - that is the consumer's job.
OnContextMenuOpened EventCallback<DwsTreeTableNode<T>> Raised with the node the menu was opened on.
OnGroupToggled EventCallback<DwsTreeTableNode<T>> Raised when a group heading is expanded or collapsed. OnNodeToggled is not raised for headings.
OnChildrenLoaded EventCallback<DwsTreeTableNode<T>> Raised after a lazy load completes for a node.
OnNodeDragStart EventCallback<DwsTreeTableNode<T>> Raised when a row is picked up.
OnNodeDragEnd EventCallback<DwsTreeTableNode<T>> Raised when a drag ends without a move: cancelled, released outside the table, or refused.
OnNodeDrop EventCallback<DwsTreeTableNodeDropEventArgs<T>> Raised with the new parent and the index among its siblings. Set args.Cancel to reject the move.
OnBreadcrumbClick EventCallback<DwsTreeTableNode<T>> Raised when a breadcrumb step is clicked.
Name Typ Default Description
Element ElementReference The associated web component. May be null if accessed before the component is rendered.
ComponentGuid Guid Unique identifier for the component.
TypeString string The name of the component type, obtained from reflection.
Authorized_RegisterEnabled bool false Indicates whether this component is enabled through a permission registry.
Authorized_RegisterSelected bool false Indicates whether this component is selected in permission selection mode.
GetInitializedState bool false Returns whether the component is initialized.
GetRenderModeState DwsRenderMode Returns the current render mode.
GetComponentState DwsComponentStateType Returns the current component state.
GetIsInteractiveState bool false Returns whether the component is interactive.
GetIsPrerenderingState bool false Returns whether the component is prerendering.
GetComponentLoadingState bool false Returns whether the component is loading.
IsFormBusy bool false Whether the DwsForm (or DwsFormBusyRegion) around the component is locked because its submit handler is running. The state itself is the cascaded FormBusyState (IDwsFormBusyState).
Name Typ Parameters Description
DebugInfo void Logs debug information about the component.
UpdateState void Updates the component's state and triggers StateHasChanged.
UpdateStateAsync Task Asynchronously updates the component's state and triggers StateHasChanged.
Dispose void Disposes the component and releases resources.
FocusAsync ValueTask bool containedInScrollableList Sets focus to the component's element.
Name Typ Default Description
Name string Required unique identifier for the component within its container.
Visible bool true Determines if the component is visible in the UI.
Disabled bool false Disables the form control, ensuring it doesn't participate in form submission.
ComponentNameSpace string The namespace for permission-based access control.
PermissionKey string? null A stable key that takes the place of Name in the generated permission namespace (Page.PermissionKey): the stored permission survives a rename, and components that share a key share one permission entry. Null: keyed by Name. Read once, when the component registers; an explicit ComponentNameSpace wins.
Class string Optional CSS class names.
Style string Optional in-line styles.
Tag object An optional user-defined object to store any additional data with the component.
BackReference DwsReference A reference to the enclosing component.
ID string The HTML ID attribute for the component.
AdditionalAttributes Dictionary<string, object> Additional HTML attributes for the component's root element.
IgnorePermissionChecks bool false Bypasses all permission checks for this component.
IgnorePermissionSelection bool false Ignore permission selection mode for this component.
IgnoreFormBusy bool false Takes the component out of the submit lock of the DwsForm (or DwsFormBusyRegion) around it: IsFormBusy stays false for it.
Name Typ Description
OnInitializedCallbackStarted EventCallback Callback when OnInitialized starts.
OnInitializedCallback EventCallback Callback during OnInitialized.
OnInitializedCallbackCompleted EventCallback Callback when OnInitialized completes.
OnInitializedAsyncCallbackStarted EventCallback Callback when OnInitializedAsync starts.
OnInitializedAsyncCallback EventCallback Callback during OnInitializedAsync.
OnInitializedAsyncCallbackCompleted EventCallback Callback when OnInitializedAsync completes.
OnIsComponentLoadingChanged EventCallback<bool> Callback when IsComponentLoading changes.
OnCurrentRenderModeChanged EventCallback<DwsRenderMode> Callback when CurrentRenderMode changes.
OnComponentStateChanged EventCallback<DwsComponentStateType> Callback when ComponentState changes.
An error has occurred. This app may no longer respond until reloaded.