From 97d7f4e76849ef6ac39931351de156831862b560 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 17 May 2026 14:42:37 +0800 Subject: [PATCH 01/11] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E6=9B=B4?= =?UTF-8?q?=E6=94=B9=E5=8E=9F=E5=A7=8B=E5=88=97=E5=AE=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs b/src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs index 7bbb96aa5af..ba9be85bb96 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs +++ b/src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs @@ -568,9 +568,6 @@ private void ResetVisibleColumnsCache() { item.DisplayName = col.GetDisplayName(); - // 恢复宽度 - col.Width = item.Width; - // 增加到可见列缓存集合 _visibleColumnsCache.Add(col); } From d8e887ea4c285c13d3e7ff1a6e168b2133397fe6 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 17 May 2026 14:50:19 +0800 Subject: [PATCH 02/11] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=20AutoFitC?= =?UTF-8?q?olumnWidthCallback=20=E5=9B=9E=E8=B0=83=E4=B8=8E=E5=88=97?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9B=9E=E8=B0=83=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Table/Table.razor.cs | 16 +--------------- .../Components/Table/Table.razor.js | 2 +- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.cs b/src/BootstrapBlazor/Components/Table/Table.razor.cs index 55825952ff4..7a72ae2a39a 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.cs +++ b/src/BootstrapBlazor/Components/Table/Table.razor.cs @@ -1403,7 +1403,6 @@ private async Task OnTableRenderAsync(bool firstRender) TableName = ClientTableName, DragColumnCallback = nameof(DragColumnCallback), FitColumnWidthIncludeHeader, - AutoFitColumnWidthCallback = nameof(AutoFitColumnWidthCallback), ResizeColumnCallback = nameof(ResizeColumnCallback), ColumnMinWidth = ColumnMinWidth ?? Options.CurrentValue.TableSettings.ColumnMinWidth, ColumnStates = _tableColumnStates, @@ -1946,21 +1945,8 @@ public async Task ResizeColumnCallback(string name, TableColumnClientStatus colu { await OnTableColumnClientStatusChanged(name, _tableColumnStateCache); } - } - /// - /// 列宽自适应回调方法 由 JavaScript 脚本调用 - /// Auto Fit Column Width Callback called by JavaScript - /// - [JSInvokable] - public async Task AutoFitColumnWidthCallback(string fieldName, TableColumnClientStatus columnState) - { - UpdateTableColumnState(columnState); - - if (OnTableColumnClientStatusChanged != null) - { - await OnTableColumnClientStatusChanged(fieldName, _tableColumnStateCache); - } + StateHasChanged(); } private void UpdateTableColumnState(TableColumnClientStatus columnState) diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.js b/src/BootstrapBlazor/Components/Table/Table.razor.js index 9ac7da94bce..7fd362ee3e4 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.js +++ b/src/BootstrapBlazor/Components/Table/Table.razor.js @@ -623,7 +623,7 @@ const autoFitColumnWidth = async (table, col) => { const state = getColumnStateObject(table); saveColumnStateToLocalstorage(table, state); - await table.invoke.invokeMethodAsync(table.options.autoFitColumnWidthCallback, field, state); + await table.invoke.invokeMethodAsync(table.options.resizeColumnCallback, field, state); } } From 034566f599780582c6da5db79f55aa82fa3ab764 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 17 May 2026 14:54:03 +0800 Subject: [PATCH 03/11] =?UTF-8?q?refactor:=20=E5=BE=AA=E7=8E=AF=20col=20?= =?UTF-8?q?=E6=94=B9=E7=94=A8=20=5FtableColumnStates=20=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Table/Table.razor | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/BootstrapBlazor/Components/Table/Table.razor b/src/BootstrapBlazor/Components/Table/Table.razor index 8b500b86944..2331be37e75 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor +++ b/src/BootstrapBlazor/Components/Table/Table.razor @@ -249,9 +249,12 @@ { } - @foreach (var col in GetVisibleColumns()) + @foreach (var col in _tableColumnStates) { - + if (col.Visible) + { + + } } @if (ShowExtendButtons && !IsExtendButtonsInRowHeader) { From 08a6c8dcf21f381aeb934d8881c805ef5dd7e2fc Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 17 May 2026 14:54:16 +0800 Subject: [PATCH 04/11] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E7=AB=AF=E8=84=9A=E6=9C=AC=E8=B0=83=E7=94=A8=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Table/Table.razor.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.cs b/src/BootstrapBlazor/Components/Table/Table.razor.cs index 7a72ae2a39a..62b910e9cf5 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.cs +++ b/src/BootstrapBlazor/Components/Table/Table.razor.cs @@ -1893,8 +1893,6 @@ public async Task ClearTableColumnClientStatus() // 清除缓存的列状态 _tableColumnStateCache.Clear(); - _resetColumns = true; - _invoke = true; StateHasChanged(); } From 255134bf0bfca4eaa42ee42262a922b3b45404c3 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 17 May 2026 14:54:24 +0800 Subject: [PATCH 05/11] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Samples/Table/TablesColumnDrag.razor | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor index 6f87849b8df..81167c8a4a7 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor @@ -8,14 +8,14 @@

@Localizer["TablesColumnDescription"]

-@* - *@ + +
@((MarkupString)Localizer["AllowDragOrderDesc"].Value)
- @@ -30,10 +30,10 @@ @code { - // private Table Table { get; set; } + private Table Table { get; set; } - // private async Task Reset() - // { - // await Table.ClearTableColumnClientStatus(); - // } + private async Task Reset() + { + await Table.ClearTableColumnClientStatus(); + } } From 0c3a9dd79de159e2af7627583619954c7826a79e Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 17 May 2026 15:05:40 +0800 Subject: [PATCH 06/11] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E4=B8=8D?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=9A=84=E6=89=A9=E5=B1=95=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Extensions/ITableColumnExtensions.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/BootstrapBlazor/Extensions/ITableColumnExtensions.cs b/src/BootstrapBlazor/Extensions/ITableColumnExtensions.cs index cdc7a5b05db..de41a8c0634 100644 --- a/src/BootstrapBlazor/Extensions/ITableColumnExtensions.cs +++ b/src/BootstrapBlazor/Extensions/ITableColumnExtensions.cs @@ -443,6 +443,4 @@ private static RenderFragment RenderContent(this ITableColumn col, string? text) internal static bool GetShowTips(this ITableColumn col) => col.ShowTips ?? false; internal static Alignment GetAlign(this ITableColumn col) => col.Align ?? Alignment.None; - - internal static int? GetColumnFixedWidth(this ITableColumn col, int width) => col.Fixed ? col.Width ?? width : col.Width; } From e1b9467f0966effdbc8af3deee6d935ce44cfbfd Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 17 May 2026 15:05:50 +0800 Subject: [PATCH 07/11] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Samples/Table/TablesColumnDrag.razor | 11 +---------- .../Samples/Table/TablesColumnDrag.razor.cs | 8 ++++++++ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor index 81167c8a4a7..0f4f426ad50 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor @@ -15,7 +15,7 @@
@@ -28,12 +28,3 @@
- -@code { - private Table Table { get; set; } - - private async Task Reset() - { - await Table.ClearTableColumnClientStatus(); - } -} diff --git a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor.cs index 8e73671b32e..d787c6fef5f 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor.cs @@ -17,6 +17,7 @@ public partial class TablesColumnDrag /// [NotNull] private List? Items { get; set; } + private static IEnumerable PageItemsSource => new int[] { 5, @@ -27,6 +28,8 @@ public partial class TablesColumnDrag [NotNull] private ConsoleLogger? Logger { get; set; } + private Table _table = default!; + /// /// /// @@ -69,4 +72,9 @@ private Task> OnQueryAsync(QueryPageOptions options) items = items.Skip((options.PageIndex - 1) * options.PageItems).Take(options.PageItems).ToList(); return Task.FromResult(new QueryData() { Items = items, TotalCount = total, IsSorted = isSorted, IsFiltered = isFiltered, IsSearch = true }); } + + private Task Reset() + { + return _table.ClearTableColumnClientStatus(); + } } From a735ddedfff6a38b15cd29f883292da49c08606c Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 17 May 2026 15:05:58 +0800 Subject: [PATCH 08/11] =?UTF-8?q?test:=20=E6=9B=B4=E6=96=B0=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/UnitTest/Components/TableTest.cs | 50 +++------------------------ 1 file changed, 5 insertions(+), 45 deletions(-) diff --git a/test/UnitTest/Components/TableTest.cs b/test/UnitTest/Components/TableTest.cs index 84094e3b45a..aeb7c9fb7f3 100644 --- a/test/UnitTest/Components/TableTest.cs +++ b/test/UnitTest/Components/TableTest.cs @@ -8734,49 +8734,6 @@ public void ShowRowCheckboxCallback_Ok() Assert.Single(table.Instance.SelectedRows); } - [Fact] - public async Task OnTableColumnClientStatusChanged_AutoFitColumnWidth_Ok() - { - var name = ""; - TableColumnClientStatus? clientState = null; - var localizer = Context.Services.GetRequiredService>(); - var cut = Context.Render(pb => - { - pb.AddChildContent>(pb => - { - pb.Add(a => a.RenderMode, TableRenderMode.Table); - pb.Add(a => a.AllowDragColumn, true); - pb.Add(a => a.ClientTableName, "table-unit-test"); - pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer)); - pb.Add(a => a.FitColumnWidthIncludeHeader, true); - pb.Add(a => a.OnTableColumnClientStatusChanged, (fieldName, state) => - { - name = fieldName; - clientState = state; - return Task.CompletedTask; - }); - pb.Add(a => a.TableColumns, foo => builder => - { - builder.OpenComponent>(0); - builder.AddAttribute(1, "Field", "Name"); - builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string))); - builder.CloseComponent(); - - builder.OpenComponent>(0); - builder.AddAttribute(3, "Field", "Address"); - builder.AddAttribute(4, "FieldExpression", Utility.GenerateValueExpression(foo, "Address", typeof(string))); - builder.CloseComponent(); - }); - }); - }); - - var table = cut.FindComponent>(); - var state = new TableColumnClientStatus() { Columns = [] }; - await cut.InvokeAsync(() => table.Instance.AutoFitColumnWidthCallback(nameof(Foo.DateTime), state)); - Assert.Equal(nameof(Foo.DateTime), name); - Assert.NotNull(clientState); - } - [Fact] public async Task AllowDragColumn_Ok() { @@ -8865,6 +8822,7 @@ public async Task OnTableColumnClientStatusChanged_ResizeColumn_Ok() pb.Add(a => a.ClientTableName, "test"); pb.Add(a => a.RenderMode, TableRenderMode.Table); pb.Add(a => a.AllowResizing, true); + pb.Add(a => a.FitColumnWidthIncludeHeader, true); pb.Add(a => a.OnTableColumnClientStatusChanged, (field, state) => { name = field; @@ -8936,12 +8894,14 @@ public async Task ClearTableColumnClientStatus_Ok() // 由于启用了客户端持久化 Name 列宽使用 100 而非 80 var table = cut.FindComponent>(); - Assert.Equal(100, table.Instance.Columns[0].Width); + var colGroup = table.Find("colgroup"); + Assert.Contains("style=\"width: 100px;\"", colGroup.ToMarkup()); + Assert.Contains("style=\"width: 120px;\"", colGroup.ToMarkup()); // 清除客户端状态 await cut.InvokeAsync(() => table.Instance.ClearTableColumnClientStatus()); invoker.VerifyInvoke("clearColumnStates"); - Assert.Equal(80, table.Instance.Columns[0].Width); + Assert.Contains("style=\"width: 80px;\"", colGroup.ToMarkup()); } [Theory] From d1d5fd126e337adc56726610a4783882de0e8293 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 17 May 2026 15:15:43 +0800 Subject: [PATCH 09/11] =?UTF-8?q?doc:=20=E5=A2=9E=E5=8A=A0=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E6=8C=89=E9=92=AE=E6=9C=AC=E5=9C=B0=E5=8C=96=E8=B5=84?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Samples/Table/TablesColumnDrag.razor | 9 +++++++-- src/BootstrapBlazor.Server/Locales/en-US.json | 2 ++ src/BootstrapBlazor.Server/Locales/zh-CN.json | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor index 0f4f426ad50..654f4695567 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/Table/TablesColumnDrag.razor @@ -8,10 +8,12 @@

@Localizer["TablesColumnDescription"]

- -
@((MarkupString)Localizer["AllowDragOrderDesc"].Value)
+
+

@((MarkupString)Localizer["AllowDragOrderDesc"].Value)

+

@((MarkupString)Localizer["ClearTableColumnClientStatusDesc"].Value)

+
+ + +
diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index 6a1a6bfe01d..4b79170e473 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -4607,6 +4607,8 @@ }, "BootstrapBlazor.Server.Components.Samples.Table.TablesColumnDrag": { "AllowDragOrderDesc": "

Pressing the mouse over a column heading and dragging it to another column heading position can adjust the column to be in front of the target column, but the built-in columns in the Table component, such as detail row, row number, selection, and operation columns, cannot be adjusted

This example enables local storage by setting the ClientTableName parameter. After dragging and adjusting the order, the page can be refreshed, and the column order remains in the previous state

After version 10.6.1, use OnTableColumnClientStatusChanged to uniformly handle column dragging, column resizing, and auto-fit column width callbacks, replacing the original OnDragColumnEndAsync, OnResizeColumnAsync, and OnAutoFitContentAsync callbacks.

Notes:

Table state persistence has two modes. If the ClientTableName property is set, browser local storage is used to persist information. If it is not set, server-side storage persistence is implemented through callbacks. The persistence structure is TableColumnClientStatus, which consists of the column state collection and the table width parameter.

The table width parameter defaults to 0. When all columns have width values, the table width parameter is the actual width rendered on the client. A value of 0 means the table width is adaptive.

When using browser local storage for persistence, no additional settings are required. The table automatically loads the client state.

When using server-side storage for persistence, handle table state loading and saving logic in callbacks. In actual use, the state can be stored in a database or other storage as needed. Use the OnTableColumnClientStatusChanged callback to handle server-side state changes, and use the OnLoadTableColumnClientStatus callback to restore the table persistence state.

", + "ClearTableColumnClientStatusDesc": "By calling the ClearTableColumnClientStatus method of the table component instance, the current persistent settings are cleared, restoring the table to its default settings.", + "ResetButtonText": "Reset", "AllowDragOrderIntro": "By specifying AllowDragColumn, set the table columns to allow dragging column headings to adjust the table column order", "AllowDragOrderTitle": "Allow dragging column headings to adjust table column order", "TablesColumnDescription": "Used to display multiple pieces of data with similar structures, data can be sorted, filtered, compared or other custom operations.", diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json index 45fb3a96089..fdaf580ce06 100644 --- a/src/BootstrapBlazor.Server/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json @@ -4607,6 +4607,8 @@ }, "BootstrapBlazor.Server.Components.Samples.Table.TablesColumnDrag": { "AllowDragOrderDesc": "

在列标题上按下鼠标拖动到其他列标题位置可将该列调整至目标列之前,但 Table 组件内置的列如明细行列、行号列、选择列、操作列等不可被调整

本示例通过设置 ClientTableName 参数开启了本地化存储,拖动调整顺序后,可刷新页面,列顺序是保持上次状态的

10.6.1 版本后使用 OnTableColumnClientStatusChanged 统一处理列拖拽、列宽调整与自适应列宽回调,移除原 OnDragColumnEndAsync OnResizeColumnAsyncOnAutoFitContentAsync 回调。

注意事项:

表格状态持久化功能分两种情况,设置 ClientTableName 属性即使用浏览器本地存储持久化信息,如果未设置则通过回调使用服务器端存储持久化信息。持久化信息结构体为 TableColumnClientStatus 由列状态集合以及表格宽度参数组成。

表格宽度参数默认为 0 当所有列宽度均有值时,表格宽度参数值为表格在客户端渲染的实际宽度;为 0 表示表格宽度自适应

使用浏览器本地存储持久化信息时,无需任何设置,表格会自动加载客户端状态

使用服务器端存储持久化信息时,需在回调中处理表格状态加载与保存逻辑,实际使用中可根据需要使用数据库或其他方式进行存储;通过 OnTableColumnClientStatusChanged 回调处理服务器端状态,通过 OnLoadTableColumnClientStatus 回调方法对表格进行持久化状态恢复操作

", + "ClearTableColumnClientStatusDesc": "通过调用表格组件实例方法 ClearTableColumnClientStatus 清除当前持久化设置恢复表格为默认设置", + "ResetButtonText": "重置", "AllowDragOrderIntro": "通过指定 AllowDragColumn 设置表格列允许拖动列标题调整表格列顺序", "AllowDragOrderTitle": "允许拖动列标题调整表格列顺序", "TablesColumnDescription": "用于展示多条结构类似的数据,可对数据进行排序、筛选、对比或其他自定义操作。", From d6ac381b7fce85e60d87eef7cda0dc5b7f929d3d Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 17 May 2026 15:15:51 +0800 Subject: [PATCH 10/11] =?UTF-8?q?test:=20=E8=A1=A5=E5=85=85=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/UnitTest/Components/TableTest.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/UnitTest/Components/TableTest.cs b/test/UnitTest/Components/TableTest.cs index aeb7c9fb7f3..e4738edb5f6 100644 --- a/test/UnitTest/Components/TableTest.cs +++ b/test/UnitTest/Components/TableTest.cs @@ -899,8 +899,11 @@ public async Task ShowColumnList_Ok() // 设置客户端存储 var state = new TableColumnClientStatus(); state.TableWidth = 500; - state.Columns.Add(new TableColumnState() { Name = nameof(Foo.Name), Visible = false }); - state.Columns.Add(new TableColumnState() { Name = nameof(Foo.Address), Visible = true, Width = 120 }); + state.Columns = new List() + { + new TableColumnState() { Name = nameof(Foo.Name), Visible = false }, + new TableColumnState() { Name = nameof(Foo.Address), Visible = true, Width = 120 } + }; Context.JSInterop.Setup("getColumnStates", "test").SetResult(state); var show = false; From 009f6e7d07c3f18f43a86fa982b553114eabe299 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 17 May 2026 15:17:04 +0800 Subject: [PATCH 11/11] chore: bump version 10.6.1-beta21 --- src/BootstrapBlazor/BootstrapBlazor.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index 535963d16be..aae137acf75 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@  - 10.6.1-beta20 + 10.6.1-beta21