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

Feb 2, 2009 at 12:53 PM
Edited Feb 2, 2009 at 3:35 PM
Hello,

i build a datatemplate for my own type.

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

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

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