diff --git a/src/Avalonia.Controls.DataGrid/DataGridRows.cs b/src/Avalonia.Controls.DataGrid/DataGridRows.cs index 44079d24d0..107a2a7353 100644 --- a/src/Avalonia.Controls.DataGrid/DataGridRows.cs +++ b/src/Avalonia.Controls.DataGrid/DataGridRows.cs @@ -2970,10 +2970,7 @@ namespace Avalonia.Controls if (detailsContent != null) { _rowsPresenter.Children.Add(detailsContent); - if (dataItem != null) - { - detailsContent.DataContext = dataItem; - } + detailsContent.DataContext = dataItem; detailsContent.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); RowDetailsHeightEstimate = detailsContent.DesiredSize.Height; _rowsPresenter.Children.Remove(detailsContent);