This is a migrated thread and some comments may be shown as answers.

Invalid attribute value "HeaderTemplate"

2 Answers 63 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
stephen
Top achievements
Rank 1
stephen asked on 20 Jul 2010, 08:46 AM
Hi, 

I followed the tutorial here: http://www.telerik.com/help/silverlight/radtabcontrol-item-templates-and-selectors.html to bind the headers of my tabs to data like this:

<telerikNavigation:RadTabControl.ItemContainerStyle>
                    <Style TargetType="telerikNavigation:RadTabControl">
                        <Setter Property="HeaderTemplate">
                            <Setter.Value>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock x:Name="HeaderText" Text="{Binding Header}" />
                                    </StackPanel>
                                </DataTemplate>
                            </Setter.Value>
                        </Setter>
                </Style>

But I get an error at runtime saying "Invalid attribute value "HeaderTemplate"  for property Property on the:
     <Setter Property="HeaderTemplate"> line.

I've set a ContentTemplate up to bind to the class which is working for the content of the tabs, but I cant set the header.
Thanks

2 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 22 Jul 2010, 08:42 AM
Hello stephen,

The TargetType of the Style defined as an ItemContainerStyle should be telerikNavigation:RadTabItem:
<telerikNavigation:RadTabControl.ItemContainerStyle>
    <Style TargetType="telerikNavigation:RadTabItem">
        <Setter Property="HeaderTemplate">
            <Setter.Value>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock x:Name="HeaderText" Text="{Binding Header}" />
                    </StackPanel>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</telerikNavigation:RadTabControl.ItemContainerStyle>

Give it a try and let me know if it works for you or if you need more info.

Kind regards,
Tina Stancheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
stephen
Top achievements
Rank 1
answered on 22 Jul 2010, 08:56 AM
that works, thanks very much!
Tags
TabControl
Asked by
stephen
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
stephen
Top achievements
Rank 1
Share this question
or