From 8d09099bbc059ecb8624d5cc83a01f3ec33d4a5a Mon Sep 17 00:00:00 2001 From: tesar-tech Date: Thu, 31 Oct 2024 19:39:36 +0100 Subject: [PATCH] fix datagrid header column width. closes #5804 --- Source/Extensions/Blazorise.DataGrid/DataGrid.razor.cs | 1 + Source/Extensions/Blazorise.DataGrid/DataGridColumn.cs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Source/Extensions/Blazorise.DataGrid/DataGrid.razor.cs b/Source/Extensions/Blazorise.DataGrid/DataGrid.razor.cs index 1d58e4175f..9ff91c79f6 100644 --- a/Source/Extensions/Blazorise.DataGrid/DataGrid.razor.cs +++ b/Source/Extensions/Blazorise.DataGrid/DataGrid.razor.cs @@ -2866,6 +2866,7 @@ internal IEnumerable> DisplayableColumns for ( int i = 0; i < orderedDisplayColumns.Count; i++ ) { var displayColumn = orderedDisplayColumns[i]; + displayColumn.SetWidthToNull(); var colSpan = 1; if ( !string.IsNullOrWhiteSpace( displayColumn.HeaderGroupCaption ) && orderedDisplayColumns.Count > i + 1 ) diff --git a/Source/Extensions/Blazorise.DataGrid/DataGridColumn.cs b/Source/Extensions/Blazorise.DataGrid/DataGridColumn.cs index f4f0266f6c..e469e45d58 100644 --- a/Source/Extensions/Blazorise.DataGrid/DataGridColumn.cs +++ b/Source/Extensions/Blazorise.DataGrid/DataGridColumn.cs @@ -383,6 +383,8 @@ internal DataGridColumnFilterMethod GetDataGridFilterMethodAsColumn() : ParentDataGrid.FilterMethod == DataGridFilterMethod.NotEquals ? DataGridColumnFilterMethod.NotEquals : DataGridColumnFilterMethod.Contains; } + + internal void SetWidthToNull()=> Width = null;//to supress BL0005 #endregion