RadBreadcrumItem Container Style Does Not Work

3 posts, 0 answers
  1. reg
    reg avatar
    6 posts
    Member since:
    Jan 2011

    Posted 12 Jun 2012 Link to this post

    Hi,

    Please could you inform me why I cannot set an ItemContainerStyle for a RadBreadcrumbItem. I thought that I may be able to use a style to set a default image, with the following XAML...

    <telerik:RadBreadcrumb.ItemContainerStyle>
                    <Style TargetType="{x:Type telerik:RadBreadcrumbItem}">
                        <Setter Property="Image" Value="{StaticResource Folder16}"/>
                    </Style>
                </telerik:RadBreadcrumb.ItemContainerStyle>

    However, I get the following error at runtime....

    {"'RadBreadcrumbItem' type must derive from FrameworkElement or FrameworkContentElement."}

    Thanks
  2. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 13 Jun 2012 Link to this post

    Hello reg,
    The problem with your code is that the target type should be RadBreadcrumbBarItem instead of RadBreadcrumbItem (the barItems are the real containers):
    xmlns:breadcrumb="clr-namespace:Telerik.Windows.Controls.Breadcrumb;assembly=Telerik.Windows.Controls.Navigation"
    ...
    <telerik:RadBreadcrumb>
        <telerik:RadBreadcrumb.ItemContainerStyle>
            <Style TargetType="{x:Type breadcrumb:RadBreadcrumbBarItem}">
                <Setter Property="Image" Value="{StaticResource Folder16}" />
            </Style>
        </telerik:RadBreadcrumb.ItemContainerStyle>
    </telerik:RadBreadcrumb>
    If you have more questions please feel free to ask.

    Regards,
    Zarko
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. reg
    reg avatar
    6 posts
    Member since:
    Jan 2011

    Posted 17 Jun 2012 Link to this post

    Many thanks, that fixed it.
Back to Top