Browse Source

Fixed issue where RowDetailsTemplate was getting the wrong DataContext

pull/12174/head
Gundlack Florian 3 years ago
parent
commit
22ef68e439
  1. 5
      src/Avalonia.Controls.DataGrid/DataGridRows.cs

5
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);

Loading…
Cancel
Save