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

How do I set the default carousel item I want to be displayed?

3 Answers 160 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 1
Tony asked on 03 Feb 2015, 06:52 PM
I'm sure I've missed some obscure piece of example code listed somewhere but all I want to know, for now, is how do I tell the carousel what item to place as the foremost item. Out of a carousel of 10 pics, I want pic #5 to be the first item displayed upon the carousel being rendered. I do think I tripped over a possible clue once in a random post to someone's answer but can't seem to locate that little pebble. So after countless posts and documents I'm just wanting to know how do I do this simple thing. Exasperated. 

Thanks in advance,

Tony

3 Answers, 1 is accepted

Sort by
0
Accepted
Boris
Telerik team
answered on 04 Feb 2015, 01:38 PM
Hello Tony,

Could you please check the Programatically Controlling or Moving the Carousel items forum thread and let us know if Maya's solution is applicable to your case? 

Keep in mind that for this solution to work you will need to make sure that the Carousel is properly loaded. In order to do that you can subscribe to the Loaded event of RadCarousel like so:


public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
                 
            this.radCarousel.Loaded += radCarousel_Loaded;
        }
 
        void radCarousel_Loaded(object sender, RoutedEventArgs e)
        {
            var myCarousel = (sender as RadCarousel);
 
            myCarousel.SelectedItem = myCarousel.Items[5];
            myCarousel.BringDataItemIntoView(myCarousel.SelectedItem);         
        }
    }


Regards,
Boris
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Tony
Top achievements
Rank 1
answered on 04 Feb 2015, 04:34 PM
Boris thank you for the response. Yes that answers that question perfectly. And actually right after posting my question I actually found the answer in a different forum post so this simply confirms it.  However this leads me to my overall question. While I do enjoy the products and the functionality they provide the lack of instruction in the online help/documentation seriously undermines, in my opinion, the worth and effort it takes to sometimes understand how things work.

For instance, this issue I had of just choosing which item displays first would seem relatively simple in my view but the implementation for it doesn't seem to reside where are all the other documentation is, instead I had to scour help forums for what seems a really minor thing and I'm really a bit baffled by that. While your products may work, in my view, your documentation is lacking in areas that would really help in some fundamental ways.




0
Boris
Telerik team
answered on 05 Feb 2015, 08:21 AM
Hello Tony,

I am glad that the proposed solution works is applicable to your case and thank you for your valuable feedback about our documentation, we will make sure to improve it.

Regards,
Boris
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Carousel
Asked by
Tony
Top achievements
Rank 1
Answers by
Boris
Telerik team
Tony
Top achievements
Rank 1
Share this question
or