From eb8de3433477ef968877d92add1220851f1e18b0 Mon Sep 17 00:00:00 2001 From: sdoroff Date: Wed, 29 Apr 2020 07:28:58 -0400 Subject: [PATCH] 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];