Dynamic imagekey change

6 posts, 0 answers
  1. Jorge Delgado-Lopez
    Jorge Delgado-Lopez avatar
    82 posts
    Member since:
    Aug 2007

    Posted 12 Oct 2009 Link to this post

    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
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 15 Oct 2009 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Przemysław Dzierżak
    Przemysław Dzierżak avatar
    5 posts
    Member since:
    Mar 2010

    Posted 28 May 2010 Link to this post

    We run into the same problem in 2010 Q1 504 version...
  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 03 Jun 2010 Link to this post

    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.
  6. george mcnitt
    george mcnitt avatar
    14 posts
    Member since:
    May 2010

    Posted 14 Jul 2010 Link to this post

    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.
  7. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 20 Jul 2010 Link to this post

    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
Back to Top
UI for WinForms is Visual Studio 2017 Ready