Skip to content

Commit 4c6ec97

Browse files
vnbaaijdvoituron
andauthored
Fix #3178 (#3189)
Co-authored-by: Denis Voituron <dvoituron@outlook.com>
1 parent 9556a35 commit 4c6ec97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Core/Components/DataGrid/FluentDataGrid.razor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,8 @@ private void FinishCollectingColumns()
490490
throw new Exception("You can use either the 'GridTemplateColumns' parameter on the grid or the 'Width' property at the column level, not both.");
491491
}
492492

493-
if (string.IsNullOrWhiteSpace(_internalGridTemplateColumns))
493+
// Always re-evaluate after collecting columns when using displaymode grid. A column might be added or hidden and the _internalGridTemplateColumns needs to reflect that.
494+
if (DisplayMode == DataGridDisplayMode.Grid)
494495
{
495496
if (!AutoFit)
496497
{
@@ -501,7 +502,6 @@ private void FinishCollectingColumns()
501502
{
502503
_internalGridTemplateColumns = string.Join(" ", _columns.Select(x => x.Width ?? "auto"));
503504
}
504-
505505
}
506506

507507
if (ResizableColumns)

0 commit comments

Comments
 (0)