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

4 posts, 1 answers
  1. Tony
    Tony avatar
    24 posts
    Member since:
    Sep 2014

    Posted 03 Feb 2015 Link to this post

    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
  2. Answer
    Boris
    Admin
    Boris avatar
    276 posts

    Posted 04 Feb 2015 Link to this post

    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.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Tony
    Tony avatar
    24 posts
    Member since:
    Sep 2014

    Posted 04 Feb 2015 in reply to Boris Link to this post

    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.




  5. Boris
    Admin
    Boris avatar
    276 posts

    Posted 05 Feb 2015 Link to this post

    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.

     
Back to Top