Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 889
  • Last Modified:

Display Images in Tree View Nodes

Hi Experts,

I need to show Icons in  the Tree View Item. My Requirement is as below.

I have a class Materials

public class Materials

{

     Public Int MaterialID{get;set;}

     public string MaterialName{get;set:}

    public observablecollection<Materials> submaterials {get;set;}

}

I have x different Material ID's  Based on the Material ID I need to display an ICON next to MaterialName, to identify the material based on the   Icon.

In My XAML i did some thing like below which is static

<ig:NodeLayout.ItemTemplate>

<StackPanel Orientation="Horizontal">
<Image Source="..\Images\folder_star.png"/>
<TextBlock Text="{Binding Data.MaterialName}" FontWeight="Bold" />
</stackPanel>

</ig:NodeLayout.ItemTemplate>

I need to change the Image source based on the Material ID.

How can i accomplish This task ,,  Do i need to save the image paths in Database and based on the material ID , do i need to use Converter and  input path dynamically to image ?.

Any Ideas or sample code will be helpful. Thanks
0
B_Pati
Asked:
B_Pati
  • 2
1 Solution
 
B_PatiAuthor Commented:
Hi ,
Any Ideas on the above  scenario.
0
 
Roopesh ReddyIT AnalystCommented:
0
 
Roopesh ReddyIT AnalystCommented:
Hi,

Did the above link helped you?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now