Browse Source

Merge pull request #12174 from Gundz/12106

Fixed issue where RowDetailsTemplate was getting the wrong DataContext
pull/12364/head
Max Katz 3 years ago
committed by GitHub
parent
commit
9808a441dc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/Avalonia.Controls.DataGrid/DataGridRows.cs

5
src/Avalonia.Controls.DataGrid/DataGridRows.cs

@ -2969,11 +2969,8 @@ namespace Avalonia.Controls
var detailsContent = RowDetailsTemplate.Build(dataItem);
if (detailsContent != null)
{
detailsContent.DataContext = dataItem;
_rowsPresenter.Children.Add(detailsContent);
if (dataItem != null)
{
detailsContent.DataContext = dataItem;
}
detailsContent.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
RowDetailsHeightEstimate = detailsContent.DesiredSize.Height;
_rowsPresenter.Children.Remove(detailsContent);

Loading…
Cancel
Save