You can use RowHeaderTemplate as follows:
<toolkit:DataGrid> <toolkit:DataGrid.RowHeaderTemplate> <DataTemplate> <TextBlock Text="{Binding Item.Titel, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type toolkit:DataGridRow}}}"/> </DataTemplate> </toolkit:DataGrid.RowHeaderTemplate> </toolkit:DataGrid>
You will also need to set AutoGenerateColumns to false and create your own columns so that the Titel property also appears as a column.
Edit
Now I understand that you want to migrate a DataGrid . I think an easy but somewhat hacky solution is to create a list of transposed objects. To do this, you need to know in advance how many objects are in the original list, and then create a new class with as many properties as there are objects.
class TransposedDetailObject { public String Column1 { get; set; } public String Column2 { get; set; } public String Column3 { get; set; } } var transposedList new List<TransposedDetailObject> { new TransposedDetailObject { Column1 = someList[0].Titel, Column2 = someList[2].Titel, Column3 = someList[3].Titel }, new TransposedDetailObject { Column1 = someList[0].Value1, Column2 = someList[2].Value1, Column3 = someList[3].Value1 }, ... };
A less “hacky” solution is to change the DataGrid control template to replace rows and columns. However, a DataGrid is a complex control, and it can be a little overwhelming to change the control pattern.
Martin liversage
source share