Custom Scroll Buttons

3 posts, 1 answers
  1. UIdev
    UIdev avatar
    74 posts
    Member since:
    Mar 2007

    Posted 08 Jun 2009 Link to this post

    Hi,

    I've made a simple program with a RadCarousel in it.  The thing is, I would like to use my own Buttons (outside the carousel) to scroll through the RadCarousel instead of the carousel's default horizontal/vertical scrollbars.  Is there any way to tell the RadCarousel to scroll one way or the other from inside a Button's MouseLeftButtonDown event handler?  I've been trying to achieve this through RaiseSelectionChangedEvent (but can't seem to access the selected item's index) or ScrollViewer (but can't/don't know how to access the carousel's internal ScrollViewer).  I haven't worked a lot with scrolling in WPF before, so I may be missing something obvious.  Any light you could shed on this problem would be very much appreciated!

    Thanks,

    UIdev
  2. Answer
    Milan
    Admin
    Milan avatar
    1989 posts

    Posted 09 Jun 2009 Link to this post

    Hi UIdev,

    The RadCarouselPanel has an API that allows you to control the movement of the carousel control. Here is how you can use the API:

    this.carousel.FindCarouselPanel().LineDown(); // moves to the next item  
    this.carousel.FindCarouselPanel().LineUp(); // moves to the previous item  
    this.carousel.FindCarouselPanel().PageUp(); // moves to the previous page  
    this.carousel.FindCarouselPanel().PageDown(); // moves to the next page  
    this.carousel.FindCarouselPanel().MoveBy(10); // moves by a specified amount 

    Here you can find more information about restyling the navigation controls - http://www.telerik.com/community/forums/wpf/carousel/controltemplate-radcarousel-scrollviewer.aspx
    I am also sending you a sample application that demonstrates several ways to modify and restyle the navigation controls.
    Hope this helps.

    Regards,
    Milan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for WPF is Visual Studio 2017 Ready
  4. UIdev
    UIdev avatar
    74 posts
    Member since:
    Mar 2007

    Posted 09 Jun 2009 Link to this post

    Milan,

    LineUp and LineDown were just the functions I was looking for.  Thanks so much for the help and the great solution!

    -UIdev
Back to Top