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

RadCarousel Removing An Item

6 Answers 143 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Seth
Top achievements
Rank 1
Seth asked on 16 May 2008, 10:07 PM
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!

6 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 17 May 2008, 11:09 AM
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
0
Dylan
Top achievements
Rank 1
answered on 23 May 2009, 08:53 PM
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)
0
Peter
Telerik team
answered on 25 May 2009, 08:10 AM
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.
0
Rafael Poggi
Top achievements
Rank 1
answered on 16 Sep 2010, 04:59 PM
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
0
Peter
Telerik team
answered on 21 Sep 2010, 02:47 PM
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
0
Rafael Poggi
Top achievements
Rank 1
answered on 21 Sep 2010, 11:53 PM
OK!

Thanks,
Rafael
Tags
Carousel
Asked by
Seth
Top achievements
Rank 1
Answers by
Peter
Telerik team
Dylan
Top achievements
Rank 1
Rafael Poggi
Top achievements
Rank 1
Share this question
or