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

Set top most item

1 Answer 49 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
RoxanaC
Top achievements
Rank 1
RoxanaC asked on 27 May 2010, 08:54 AM
Hello!
I have a carousel that is using a ListCollectionView of a "CutomObject" List as ItemsSource ( for filtering purpose I need it this way )
Every time the user creates a new CustomObject, I make a refresh setting again the ItemSource of this carousel, with this new object in it.

view = new ListCollectionView( LayoutCapturer.GetSavedLayouts() ); 
            view.Filter = FilterObject; 
            this.carousel.ItemsSource = view; 
 
            this.carouselPanel.ItemsPerPage = ( carousel.Items.Count < 15 ) ? 
                ( ( carousel.Items.Count % 2 == 0 ) ? carousel.Items.Count - 1 : carousel.Items.Count ) : 15; 

But at this point I need that the top most element of the carousel to be the CustomObject I've just created.
Is that possible?

Thank you!
Roxana

1 Answer, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 31 May 2010, 10:16 AM
Hello RoxanaC,

You may use the method BringDataItemIntoView and set as a parameter the newly-added item. For example:
this.MyCarousel.BringDataItemIntoView(this.MyCarousel.Items[5]);

I hope that helps.


Greetings,
Maya
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
Carousel
Asked by
RoxanaC
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or