Have i to create a Cell-DataTemlplate although my own Type have one?

Feb 2, 2009 at 11:53 AM
Edited Feb 2, 2009 at 2:35 PM

i build a datatemplate for my own type.

    <DataTemplate  DataType="{x:Type local:GoList+Go}">
            <TextBlock Background="{DynamicResource DataGridHeaderBackgroundBrush}" Text="{Binding Path=Day}" />
            <TextBlock Text="{Binding Path=Text}"/>

If my own type is in the datagridcell he dont use the datatemplate of my type. It only shows me the output of the ToString() Methode from my Type.

If i put my type into a ItemsControl he use my datatemplate. So my question... have i to build my own datatemplate
for the DataGridCell because the DataGridCell cant assume my DataTemplate from my own typ? I hope i explained my problem well. If you have any question ask me :)

best regards

Feb 3, 2009 at 5:02 AM
Try putting it in a DataGridTemplateColumn.CellTemplate.