Search code examples
c#infragistics

how to display image on ultra tree node?


I am using Infragistics ultrawin tree and assigning data source to it. i want to display images from data source on left side and right side of ultra tree node. Datatable will be in below format

UserImage  UserID  StatusImage
 Image1        1      image4
 Image2        2      image5
 Image3        3      image6

UserImage will dispaly before node and UserId will be dispaly as text and StatusImage will display after node text. Please help me in this regard.


Solution

  • not sure if this is what you want but here it goes and it's in VB you should be able to convert this to C#

    i am using an imagelist for this and the tree is unbound

        Dim utNode As New UltraTreeNode
    
        utNode.Text = UltraTree1.Nodes.Count + 1
    
        utNode.LeftImages.Add(Me.ImageList1.Images((UltraTree1.Nodes.Count) Mod 5))
    
        utNode.RightImages.Add(Me.ImageList1.Images((UltraTree1.Nodes.Count) Mod 5))
    
        UltraTree1.Nodes.Add(utNode)
    

    this will give you image on the left and on the right with the numbers as nodetext

    put this code behind a button's event and create an imagelist with 5 images that's it

    hope it helps