Start New Discussion within our Software Development Community
<Window.Resources>
...
...
        <DataTemplate DataType="{x:Type my:Section}">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=Name}"/>
                <TextBlock Text="  "/>
                <TextBlock Text="{Binding Path=Instructor}"/>
                <TextBlock Text="  "/>
                <TextBlock Text="{Binding Path=Cours}"/>
            </StackPanel>
        </DataTemplate>

        <DataTemplate DataType="{x:Type my:Instructor}" x:Key="InstructorDataTemp">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=FirstName}"/>
                <TextBlock Text=" "/>
                <TextBlock Text="{Binding Path=LastName}"/>
            </StackPanel>
        </DataTemplate>

        <DataTemplate DataType="{x:Type my:Cours}" x:Key="CourseDataTemp">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Path=Name}"/>
            </StackPanel>
        </DataTemplate>
...
...
</Window.Resources>

I am using the section template right now. The section template correctly displays the Section's Name, but the Instructor and Cours both show up as basic toStrings. I would like them to show up as defined in the other data templates. Any help is appreciated

Thanks

I solved it by using an IValueConverter for the instructor (in the section) and in the binding for the cours (in the section) just saying Cours.Name

This question has already been answered. Start a new discussion instead.