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

Is it possible to show more that one image in the radtreeview item

1 Answer 79 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Arshad
Top achievements
Rank 1
Arshad asked on 14 Jun 2016, 07:03 AM

I am adding image to the radtreeviewitem from resources programatically using the below code.

"/myAssembley;component/Resources/image1.png"

and the image is displaying successfully. Now i need to add another  image which needs to be displayed next to the first image in the radtreeviewitem.

Is it possible..???If so how to achieve it.?

 

Like the below attached image i need my treeviewitem to display a folder icon and a red square icon in a single treeview item.[

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 16 Jun 2016, 09:38 AM
Hi Arshad,

RadTreeView has a support only for a single image that can be displayed in the header of the RadTreeViewItem. However, I can suggest you couple custom approaches for achieving your requirement.
  • Merge both images into a single one and display it through the DefaultImageSrc property of RadTreeViewItem.
  • Or define the additional image (or both images) in the ItemTemplate of the treeview.
    <HierarchicalDataTemplate x:Key="treeViewItemTemplate">
        <StackPanel Orientation="Horizontal">
            <Image Source="Image1URI" />
            <Image Source="Image2URI" />
            <TextBlock Text="Item Header" />
        </StackPanel>
    </HierarchicalDataTemplate>

Regards,
Martin
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
TreeView
Asked by
Arshad
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or