Skip to content

Commit

Permalink
Moved detailsContent.DataContext assignation before Children.Add
Browse files Browse the repository at this point in the history
  • Loading branch information
Gundlack Florian committed Jul 13, 2023
1 parent 22ef68e commit 3fc0d19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Avalonia.Controls.DataGrid/DataGridRows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2969,8 +2969,8 @@ private void UpdateRowDetailsHeightEstimate()
var detailsContent = RowDetailsTemplate.Build(dataItem);
if (detailsContent != null)
{
_rowsPresenter.Children.Add(detailsContent);
detailsContent.DataContext = dataItem;
_rowsPresenter.Children.Add(detailsContent);
detailsContent.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
RowDetailsHeightEstimate = detailsContent.DesiredSize.Height;
_rowsPresenter.Children.Remove(detailsContent);
Expand Down

0 comments on commit 3fc0d19

Please sign in to comment.