RadCarousel Removing An Item

7 posts, 0 answers
  1. Seth
    Seth avatar
    90 posts
    Member since:
    Jun 2007

    Posted 16 May 2008 Link to this post

    I have put code into my application to remove an item from the carousel.  It removes it, but the item stays in view at the selected item position.  As I scroll around, the item is still there in the background.

    rCarFolders.Items.Remove(rCarFolders.SelectedItem)

    rCarFolders.Refresh()

    Help!

  2. Peter
    Admin
    Peter avatar
    1140 posts
    Member since:
    Sep 2012

    Posted 17 May 2008 Link to this post

    Hi Seth,

    Thank you for contacting us.

    I reproduced this issue. The following workaround removes the selected item correctly:

                if (this.radCarousel1.SelectedItem != null)
                {
                    RadItemCollection col = new RadItemCollection( this.radCarousel1.Items );
                    col.Remove((RadItem)this.radCarousel1.SelectedItem);
                    this.radCarousel1.Items.Clear();
                    this.radCarousel1.CarouselElement.BeginUpdate();
                    this.radCarousel1.Items.AddRange(col);
                    this.radCarousel1.CarouselElement.EndUpdate();
                 }

    Could you please check in your code that rCarFolders.SelectedItem is different from null?

    I believe this will help you. You can write me back if I could be of further help.
     

    Regards,
    Peter
    the Telerik team


    Instantly find answers to your questions at the new Telerik Support Center

  3. Dylan
    Dylan avatar
    3 posts
    Member since:
    Oct 2012

    Posted 23 May 2009 Link to this post

    Thanks for the workaround, it would be good to have this fixed at some point. I trust you have it logged as a defect? :)

    Inno Software Inc (www.innosoftware.net)

  4. Peter
    Admin
    Peter avatar
    1140 posts
    Member since:
    Sep 2012

    Posted 25 May 2009 Link to this post

    Hello Dylan,

    Thank you for contacting us.  We added the issue to our ToDo list. Extending the current behavior is not a simple task and hence I cannot give you a specific time frame about implementing it, however, the more people request that feature the higher its priority will be.

    Please excuse us for the introduced inconvenience.


    Kind regards,
    Peter
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

  5. Rafael Poggi
    Rafael Poggi avatar
    4 posts
    Member since:
    Oct 2012

    Posted 16 Sep 2010 Link to this post

    Hello Peter,

    I have the same problem. The workaround works fine, it actually removes the item correctly. But since the .clear and .addrange methods are used, all remaining items  in the collection "fly" again  to an initial position in the carousel. Is is possible to avoid this effect and just remove the item without notice for the user?

    Thanks,
    Rafael Poggi

  6. Peter
    Admin
    Peter avatar
    1140 posts
    Member since:
    Sep 2012

    Posted 21 Sep 2010 Link to this post

    Hello Rafael Poggi,

    RadCarousel cannot remove an item without recalculation of the coordinates of the other items. e.g. animation cannot be avoided. To avoid visual glitches we do not allow removing single items. You should call

    radCarousel1.Items.Clear();
     
    and add all other items after that
     
    radCarousel1.Items.AddRange(myItems);

    Please, excuse us for the inconvenience.

    Kind regards,
    Peter
    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

  7. Rafael Poggi
    Rafael Poggi avatar
    4 posts
    Member since:
    Oct 2012

    Posted 21 Sep 2010 Link to this post

    OK!

    Thanks,
    Rafael

Back to Top