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

Dynamic imagekey change

5 Answers 206 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
superold
Top achievements
Rank 1
superold asked on 12 Oct 2009, 10:32 AM
Hi, a breaking change has happened between 2009Q1 1414 and 2009Q2 SP1 9729.

I add images dynamically to an imagelist. Then I change the ImageKey (tried with ImageIndex as well) on a node. The image is not shown. This breaks my application which worked fine on 2009Q1 1414.

        private void radButton1_Click(object sender, EventArgs e) 
        { 
            imageList1.Images.Add(radTextBox1.Text, Image.FromFile(radTextBox1.Text)); 
 
            //radTreeView1.Nodes[0].ImageKey = radTextBox1.Text; 
 
            radTreeView1.Nodes[0].ImageIndex = imageList1.Images.IndexOfKey(radTextBox1.Text); 
        } 

Any ideas?
- jorge

5 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 15 Oct 2009, 11:17 AM
Hello Jorge Delgado-Lopez,

Thank you for reporting this. We will change the behavior back in the next release. Please set the Image property of your tree nodes directly. Your Telerik points have been updated.

Kind regards,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Przemysław Dzierżak
Top achievements
Rank 1
answered on 28 May 2010, 03:24 PM
We run into the same problem in 2010 Q1 504 version...
0
Victor
Telerik team
answered on 03 Jun 2010, 09:13 AM
Hi Przemysław Dzierżak,

Thank you for writing.

In order to work around this issue you can simply assign null to the ImageList property of RadTreeView and then assign your ImageList again. This will cause RadTreeView to refresh its image cache. Since ImageList does not provide any means through which we can know that there are new or removed images, the cache does not refresh when you add images. We decided to create this cache because of memory footprint concerns.

I hope this helps.

Sincerely yours,
Victor
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.
0
george mcnitt
Top achievements
Rank 1
answered on 14 Jul 2010, 08:34 PM
Tried your suggestion but it didnt work.

Although I dont see how to assign null to it through property manager. There is a "none" option, but like I said that didnt make any difference. The TreeView is not picking up on the new images I have added to my imagelist.

 Any other work arounds? Q1 2010 504.
0
Victor
Telerik team
answered on 20 Jul 2010, 06:35 AM
Hello george mcnitt,

I have answered your question in your other thread. Let's continue the discussion there.

Greetings,
Victor
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
Tags
Treeview
Asked by
superold
Top achievements
Rank 1
Answers by
Victor
Telerik team
Przemysław Dzierżak
Top achievements
Rank 1
george mcnitt
Top achievements
Rank 1
Share this question
or