Invalid attribute value "HeaderTemplate"

3 posts, 0 answers
  1. stephen
    stephen avatar
    19 posts
    Member since:
    Jul 2010

    Posted 20 Jul 2010 Link to this post

    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. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 22 Jul 2010 Link to this post

    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
  3. DevCraft banner
  4. stephen
    stephen avatar
    19 posts
    Member since:
    Jul 2010

    Posted 22 Jul 2010 Link to this post

    that works, thanks very much!
Back to Top