Stopping automatic scrolling when the left mouse button is down

8 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. 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
  4. 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.
  5. Scott
    Scott avatar
    2 posts
    Member since:
    Aug 2016

    Posted 01 Jun 2018 Link to this post

    I am currently experiencing a similar issue with Telerik TestStudio 2018.1.418.0. Performing a left click (either manually added or recorded), the page scrolls down and the element rolls off screen. This behavior loses focus on the pop over generated, preventing data entry in a text field, and breaks this test. 
  6. Ralitsa
    Admin
    Ralitsa avatar
    190 posts

    Posted 06 Jun 2018 Link to this post

    Hello Scott,

    Thank you for contacting us. 

    In order to continue searching the cause of the problem, I need additional information about which version of the Telerik UI for WPF is used in your application. It would be really helpful if you can reproduce the observed problem in the attached sample application and specify the exact steps to follow. Another option is sending a sample video illustrating steps on your side. You can use Jing (a free tool) for capturing the video. Thank you in advance. 

    I am looking forward to your reply.

    Regards,
    Ralitsa
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  7. Scott
    Scott avatar
    2 posts
    Member since:
    Aug 2016

    Posted 03 Sep 2018 Link to this post

    I am running Telerik Test Studio, Version 2018.2.606.0

    Here is a screencast of what I am seeing: https://www.screencast.com/t/SFPfacd2vwtm 

    Note, I am not scrolling down the grid on the page. This is being done by Telerik during play back. I've recorded Page Up keystrokes to return back to the top of the screen, as Scroll steps I've tried to add are not functioning as expected. Any help you could provide would be great. 

  8. Elena
    Admin
    Elena avatar
    1217 posts

    Posted 05 Sep 2018 Link to this post

    Hello Scott,

    Thank you for sharing a video of the misbehavior encountered. 

    I suspect you have enabled SimulateRealTyping and SimulateRealClick for some of the steps - by default that action scrolls the element to top of the page and sets focus on it. The misbehavior on your end is actually present because of the static header in the application under test. The page top is under the header and the element gets scrolled under it as well. 

    If this is the issue you could overwhelm it by converting the Click or Type step to code and then change the scroll action to scroll to bottom instead to top. The sample code should be as below: 

    Element.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementBottomAtWindowBottom);

    // Instead of 
    //Element.ScrollToVisible(ArtOfTest.WebAii.Core.ScrollToVisibleType.ElementTopAtWindowTop);

    I also noticed you are using Kendo controls in the application under test including filters and you probably know Test Studio provides translators for the Telerik controls. The steps you have recorded are through the translators and some of these steps also include the scroll to top action. I suspect this might be also causing troubles in the test execution. 

    I hope the information will be helpful for you! In case of any further assistance with Test Studio required, please consider submitting a separate ticket describing the issue in details. Thank you in advance for your understanding and cooperation! 

    Regards,
    Elena Tsvetkova
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top