Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Programatically Controlling or Moving the Carousel items

$
0
0
Hi Maya,

Thanks for the reply.

I'll try to describe what I'm trying to accomplish, and I hope you can advise me on how to get there.

So I'm trying to use the RadCarousel to only present data, without user interaction. I have real-time events, which are represented as cards in the carousel control. As a new event pops, I want it to slide in and take the topmost place in the carousel, and for all the other cards to move aside (with animation of course). The maximum items I present simultaneously (ItemsPerPage) is 7. Please see attached screen shot.

The first problem I encountered was making the first item(s), when I have less than 7 cards, to even be presented and take the topmost place. The second problem was getting the desired animation when a new item is added, and I assume it's because I'm calling the BringDataItemIntoView method (or any of the other paging alternatives) directly after adding the new item to the collection.

This is a snippet of the method that adds a new card:

publicObservableCollection<CardOwner> Owners { get; set; }
  
privatevoidAddOwner()
{
    var owner = newCardOwner()
        {
            AccessTime = DateTime.Now,
            OwnerId = _runningId++.ToString(),
            OwnerNumber = _runningNumber++.ToString()
        };
  
    if(Owners.Count == 1)
    {
        EventsCarousel.FindCarouselPanel().ItemsPerPage = 2;
    }
  
    Owners.Add(owner);
    EventsCarousel.BringDataItemIntoView(owner);
    EventsCarousel.FindCarouselPanel().ItemsPerPage = 7;
}
  
privatevoidRadCarousel_PreviewMouseWheel(objectsender, MouseWheelEventArgs e)
{
    e.Handled = true;
}

I would highly appreciate any input you might have on this.
Regards,
Nadav.

Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>