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

databound listview display image from database next to list...

1 Answer 93 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
parios
Top achievements
Rank 1
parios asked on 30 Oct 2008, 04:45 PM
I have a treeview that is as follows...

        Me.ImageTableAdapter.Fill(Me.Album_Category_Image_DataSet.Image)
        Me.AlbumTableAdapter.Fill(Me.Album_Category_Image_DataSet.Album)
        Me.CategoryTableAdapter.Fill(Me.Album_Category_Image_DataSet.Category)

        Me.RadTreeView1.RelationBindings.Add(New RelationBinding("CategoryAlbum", Me.AlbumBindingSource))
        Me.RadTreeView1.RelationBindings.Add(New RelationBinding("AlbumImage", Me.ImageBindingSource))
        Me.RadTreeView1.RootRelationDisplayName = "Categories"
        Me.RadTreeView1.DataSource = Me.CategoryBindingSource

Everything works fine... I have a 3 tables... category, album, images

album and images both have fields for their image path and filename toghether.. ie c:\something\something\image1.jpg  in the images table and c:\something\something\image2.jpg in the album table....

I want to take these fields and programatically display them next to the listview....

how do i do this?

1 Answer, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 04 Nov 2008, 08:38 AM
Hello parios,

Thank you for contacting us.

I am not sure that I completely understand your question. I think that you want to get the selected node and based on that to display an image on the form next to RadTreeView control. If so, please see the following code snippet of the Selected event:

private void radTreeView1_Selected(object sender, EventArgs e)  
{  
   Console.WriteLine(this.radTreeView1.SelectedNode.Text);  
   Console.WriteLine(this.radTreeView1.SelectedNode.Parent.Text);  
   Console.WriteLine(this.radTreeView1.SelectedNode.Parent.Parent.Text);  

Selected node text is printed as well as its parent's text and parent's parent's text.


Greetings,
Nick
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Treeview
Asked by
parios
Top achievements
Rank 1
Answers by
Nick
Telerik team
Share this question
or