How to add images?

4 posts, 0 answers
  1. Andi
    Andi avatar
    39 posts
    Member since:
    Aug 2010

    Posted 23 Aug 2010 Link to this post

    Hi there,

    I want to add images to my TreeViewItems, but it does not work :(
    I knew there are many Threads for this theme and I read many of them, but I found no answer which can help me.
    I have just a simple .xaml with the Tree and 3 Items and a folder named "Icons" in the source-folder of my project.
    What am I doing wrong?

    <Window x:Class="TreeViewTest.MainWindow"
            Title="MainWindow" Height="350" Width="525" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Icon="/TreeViewTest;component/ics.ico">
        <Grid>
            <telerik:RadTreeView  HorizontalAlignment="Left"  Name="treeView1" VerticalAlignment="Top" IsLineEnabled="True" FontFamily="Arial" FontSize="10" ImagesBaseDir="/Icons/" IsDragPreviewEnabled="False">
                <telerik:RadTreeViewItem Header="Global" DefaultImageSrc="Folder_16x16-32.png">
                    <telerik:RadTreeViewItem Header="Local 1" />
                    <telerik:RadTreeViewItem Header="Local 2" />
                </telerik:RadTreeViewItem>
            </telerik:RadTreeView>       
        </Grid>
    </Window>
  2. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 26 Aug 2010 Link to this post

    Hi Andi,


    Please accept my apology for the delayed response. Unfortunately I couldn't reproduce your issue. Can you please take a look at the project I used for testing and let me know if it works for you or if I am missing something?

    Thank you in advance.

    Sincerely yours,
    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. UI for WPF is Visual Studio 2017 Ready
  4. Andi
    Andi avatar
    39 posts
    Member since:
    Aug 2010

    Posted 26 Aug 2010 Link to this post

    Hi Tina,
    thank you for your response.
    I have found the failure. I have to add the images to my project and then it works fine.
    Sometimes the biggest bug is sitting in front of the keyboard :D
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 26 Aug 2010 Link to this post

    Hello Andi,

    I am glad you got it working. However, should you need any additional help or info, please let us know and we will be more than happy to assist you.

    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
Back to Top