Stopping automatic scrolling when the left mouse button is down

4 posts, 0 answers
  1. Adam Smith
    Adam Smith avatar
    2 posts
    Member since:
    Aug 2009

    Posted 10 Aug 2009 Link to this post

    Hi,

    Could you tell me how to stop the Carousel paging when I am holding down the left mouse button and moving my mouse cursor over the bottom of the control please?

    Thanks,

    Adam Smith
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 13 Aug 2009 Link to this post

    Hi Adam,

    You can increase the delay for the carousel paging buttons. Please check the attached project and let me know how it goes.

    Greetings,
    Vlad
    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. Adam Smith
    Adam Smith avatar
    2 posts
    Member since:
    Aug 2009

    Posted 14 Aug 2009 Link to this post

    Hi,

    Thanks for that but that did not work. I am doing a drag and drop operation (a drag from the carousel to a listbox using your drag and drop manager) and when I drag the selected item from the carousel over the bottom bound of the RadCarousel it automatically pages left... Can I stop the automatic paging behavior?

    Thanks,

    Adam
  5. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 19 Aug 2009 Link to this post

    Hello Adam Smith,

    Your could try the following:

    <telerik:RadCarousel x:Name="RadCarousel1"      
                         telerik:CarouselItem.MouseLeftButtonUp="OnMouseLeftButtonUp"      
                         telerik:CarouselItem.PreviewMouseLeftButtonDown="OnPreviewMouseLeftButtonDown">     
    </telerik:RadCarousel>   

    private void OnPreviewMouseLeftButtonDown(object sender, RoutedEventArgs e)     
    {     
        FrameworkElement dObject = (FrameworkElement)e.OriginalSource;     
        var item = dObject.ParentOfType<CarouselItem>();     
        
        if (item != null)     
            e.Handled = true;     
    }     
        
    private void OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e)     
    {     
        FrameworkElement dObject = (FrameworkElement)e.OriginalSource;     
        var item = dObject.ParentOfType<CarouselItem>();     
        
        if (item != null)     
            this.RadCarousel1.SelectedItem = ((DataRecord)item.DataContext).Data;     
    }   

    The basic idea behind the workaround is to handle the MouseDown event and move the carousel on mouse up (only if necessary). Unfortunately this workaround might interfere with the drag and drop. If it does could you send us some XAML and C# code of your application so that we can see how you are using the drag and drop and try to provide an alternative solution.

    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.
Back to Top