diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs b/src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs index 91ff894c37c..082c743d553 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs +++ b/src/BootstrapBlazor/Components/Table/Table.razor.Toolbar.cs @@ -317,8 +317,8 @@ public Func? ShowDeleteButtonCallback public bool FixedDetailRowHeaderColumn { get; set; } /// - /// 获得/设置 是否固定 LineNo 列 默认为 false 不固定 - /// Gets or sets Whether to fix LineNo Column. Default false + /// 获得/设置 是否固定 LineNo 列 默认为 false 不固定,当表格中存在固定列时,该属性值自动设为 true + /// Gets or sets Whether to fix LineNo Column. Default false.When there are fixed columns in the table, the value of this property is automatically set to true /// [Parameter] public bool FixedLineNoColumn { get; set; } diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.cs b/src/BootstrapBlazor/Components/Table/Table.razor.cs index 9d01aad5366..0eae33b8c68 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.cs +++ b/src/BootstrapBlazor/Components/Table/Table.razor.cs @@ -1610,7 +1610,7 @@ private RenderFragment RenderContentRow(TItem item) => builder => // 合并单元格情况 colIndex--; continue; - } + } // 获得单元格参数 var cellArgs = GetCellArgs(item, col, ref colIndex); @@ -1635,6 +1635,15 @@ private RenderFragment RenderContentRow(TItem item) => builder => }; builder.AddContent(0, RenderContentCell(context)); + + if (ShowLineNo && col.Fixed&& !FixedLineNoColumn) + { + // 当有显示行号列时,且当表格中列固定时,行号列也自动固定 + // 避免未设置行号列固定时,表格中其他列固定导致行号列未固定的情况,表格横向滑动时行号会隐藏 + FixedLineNoColumn = col.Fixed; + // 这里必须处理一次,以解决持久化加载时,表头先渲染导致固定列不正常 + StateHasChanged(); + } } }; diff --git a/src/BootstrapBlazor/Components/Table/TableColumnClientStatus.cs b/src/BootstrapBlazor/Components/Table/TableColumnClientStatus.cs index a8099be4cc0..a60965bfc55 100644 --- a/src/BootstrapBlazor/Components/Table/TableColumnClientStatus.cs +++ b/src/BootstrapBlazor/Components/Table/TableColumnClientStatus.cs @@ -21,8 +21,8 @@ public class TableColumnClientStatus public List Columns { get; set; } = []; /// - /// 表格宽度 - /// Table Width + /// 表格宽度,当值为 0 时表示表格宽度自适应 + /// Table Width, when the value is 0, it means the table width is auto /// [JsonPropertyName("table")] public int TableWidth { get; set; }