RadCarouselPanel Scrolling Problem

3 posts, 0 answers
  1. Shreya Goyal
    Shreya Goyal avatar
    7 posts
    Member since:
    Nov 2009

    Posted 12 Nov 2009 Link to this post

    Hi
              In RadCaraouselPanel if we are taking Buttons instead of images as given in your example,
     in this case RadCarouselPanel does not scroll on clicking on items(which are buttons here)

    Please reply as soon as possible

    Thanks in advance
    Regards
    Shreya
  2. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 12 Nov 2009 Link to this post

    Hi Shreya Goyal,

    Well, some control like Button handle mouse events and the carousel panel is unable to capture those handled events. One workaround that you can try is to listen for handled events and scroll the panel manually.

    For example:

    public Window1()
    {
        InitializeComponent();
      
        this.AddHandler(FrameworkElement.MouseLeftButtonDownEvent, 
            new MouseButtonEventHandler(Window1_MouseLeftButtonDown), true);
    }
      
    void Window1_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
    {
        var senderElement = (FrameworkElement)e.OriginalSource;
        var clickedButton = senderElement.ParentOfType<Button>();
      
        this.carouselPanel.BringItemIntoView(clickedButton, true);
    }


    Sincerely yours,
    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Shreya Goyal
    Shreya Goyal avatar
    7 posts
    Member since:
    Nov 2009

    Posted 25 Nov 2009 Link to this post

    Hi
            Thanx for ur reply. It has solved my issue.


    Regards
    Shreya
Back to Top