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

CarouselItems need to be scrolled into view

1 Answer 55 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Boots
Top achievements
Rank 1
Boots asked on 22 Dec 2009, 05:31 PM
Hello,

Just updated to version 2009.3.1208.35. Found a problem, well it worked with the last version. When i set the RadCarouselPannel ItemsPerPage to 7 and only display 6 items i need to scroll the items in order to see them. on the last version i didnt need to. I was curious if this is expected and i need to code around this?

here is a quick example
<Window  
    x:Class="WpfApplication1.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
    Title="Window1"
    <Grid> 
        <telerik:RadCarousel x:Name="RadCaoursel1"
            <telerik:RadCarousel.ItemsPanel> 
                <ItemsPanelTemplate> 
                    <telerik:RadCarouselPanel 
                            ItemsPerPage="7" /> 
                </ItemsPanelTemplate> 
            </telerik:RadCarousel.ItemsPanel> 
        </telerik:RadCarousel> 
    </Grid> 
</Window> 

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Windows; 
using System.Windows.Controls; 
using System.Windows.Data; 
using System.Windows.Documents; 
using System.Windows.Input; 
using System.Windows.Media; 
using System.Windows.Media.Imaging; 
using System.Windows.Navigation; 
using System.Windows.Shapes; 
using System.Collections.ObjectModel; 
 
namespace WpfApplication1 
    /// <summary> 
    /// Interaction logic for Window1.xaml 
    /// </summary> 
    public partial class Window1 : Window 
    { 
        public Window1() 
        { 
            InitializeComponent(); 
 
            ObservableCollection<CarouselExample> items = new ObservableCollection<CarouselExample>(); 
 
            for (int i = 0; i < 6; i++) 
            { 
                items.Add(new CarouselExample() { Name = "Test" + i }); 
            } 
            this.RadCaoursel1.ItemsSource = items
        } 
    } 
 
    public class CarouselExample 
    { 
        public String Name { get; set; } 
    } 
 

thanks much,
~Boots

1 Answer, 1 is accepted

Sort by
0
Accepted
Milan
Telerik team
answered on 25 Dec 2009, 10:17 AM
Hi Boots,

Currently this is the expected behavior - the carousel will automatically load items if there are enough items to fill all available slots. We are thinking of providing more options for the auto load behavior but for the time being you can use the BringDataItemIntoView method to load items. For example:

this.RadCarousel1.ItemsSource = data;
this.RadCarousel1.BringDataItemIntoView(this.RadCarousel1.Items[0]);

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