Replies: 5 comments 1 reply
-
There is a hack that allows to use different data templates for different types in cell. You should override |
Beta Was this translation helpful? Give feedback.
-
Is there any progress without the hack? |
Beta Was this translation helpful? Give feedback.
-
Avalonia IDataTemplate naturally act as both DataTemplate and DataTemplateSelector. |
Beta Was this translation helpful? Give feedback.
-
I think this is the answer here as well: #15380 (comment) In my opinion, this is by design in Avalonia and should be a Q&A instead. |
Beta Was this translation helpful? Give feedback.
-
In the Datagrid we can add a DataGridTemplateColumn, which accepst one DataTemplate (see here). If I want to support multiple DataTemplates the trick is to add a ContentControl inside the CellTemplate and so via the ViewLocator or local DataTemplates I can load different views. What I have is that the DataGridTemplateColumn directly accepts multiple DataTemplates and a binding to the property that can be different ViewModels. |
Beta Was this translation helpful? Give feedback.
-
WPF's DataGrid CellTemplateSelector property is missing in Avalonia. Is there any existing equivalent? It is needed to show different template based on for example what item the column is bound to.
Beta Was this translation helpful? Give feedback.
All reactions