Closed
Description
x:DataType
is implicitly assumed from the DataGrid.ItemsSource
thanks to this attribute defined on the base column class: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls.DataGrid/DataGridBoundColumn.cs#L28
It seems compiled doesn't respect AncestorType-delivered types and only expects exact match.
As a workaround, I would recommend explicitly setting x:DataType on these columns.
This specific line should be replaced
- .FirstOrDefault(n => n.Type.GetClrType().FullName == xamlType.FullName);
+ .FirstOrDefault(n => xamlType.IsAssignableFrom(n.Type.GetClrType()));
If anybody can make a quick change and simple unit test, it will be really helpful.
Originally posted by @maxkatz6 in #18186 (comment)