From eb8de3433477ef968877d92add1220851f1e18b0 Mon Sep 17 00:00:00 2001 From: sdoroff Date: Wed, 29 Apr 2020 07:28:58 -0400 Subject: [PATCH 1/2] Reset DesiredHeight before during measure Sets DataGridCells.DesiredHeight to 0 before measuring the individual cells --- .../Primitives/DataGridCellsPresenter.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Avalonia.Controls.DataGrid/Primitives/DataGridCellsPresenter.cs b/src/Avalonia.Controls.DataGrid/Primitives/DataGridCellsPresenter.cs index b014c699bb..0f513e7f42 100644 --- a/src/Avalonia.Controls.DataGrid/Primitives/DataGridCellsPresenter.cs +++ b/src/Avalonia.Controls.DataGrid/Primitives/DataGridCellsPresenter.cs @@ -269,6 +269,9 @@ namespace Avalonia.Controls.Primitives // Since we didn't know the final widths of the columns until we resized, // we waited until now to measure each cell double leftEdge = 0; + if (autoSizeHeight) + DesiredHeight = 0; + foreach (DataGridColumn column in OwningGrid.ColumnsInternal.GetVisibleColumns()) { DataGridCell cell = OwningRow.Cells[column.Index]; From d3fcebc716d81ace07b53daa416a100badc35ca2 Mon Sep 17 00:00:00 2001 From: sdoroff Date: Wed, 29 Apr 2020 16:34:10 -0400 Subject: [PATCH 2/2] Fix StringFormat in DataGridBoundColumns Prevent using the default converter when a Binding.StringFormat is present --- src/Avalonia.Controls.DataGrid/DataGridBoundColumn.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Controls.DataGrid/DataGridBoundColumn.cs b/src/Avalonia.Controls.DataGrid/DataGridBoundColumn.cs index 09c3d07a41..8e82bf1a38 100644 --- a/src/Avalonia.Controls.DataGrid/DataGridBoundColumn.cs +++ b/src/Avalonia.Controls.DataGrid/DataGridBoundColumn.cs @@ -55,7 +55,7 @@ namespace Avalonia.Controls binding.Mode = BindingMode.TwoWay; } - if (binding.Converter == null) + if (binding.Converter == null && string.IsNullOrEmpty(binding.StringFormat)) { binding.Converter = DataGridValueConverter.Instance; }