This is a migrated thread and some comments may be shown as answers.

Stopping automatic scrolling when the left mouse button is down

7 Answers 287 Views
Carousel
This is a migrated thread and some comments may be shown as answers.
Adam Smith
Top achievements
Rank 1
Adam Smith asked on 10 Aug 2009, 03:25 PM
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

7 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 13 Aug 2009, 03:10 PM
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.
0
Adam Smith
Top achievements
Rank 1
answered on 14 Aug 2009, 03:33 PM
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
0
Milan
Telerik team
answered on 19 Aug 2009, 10:46 AM
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.
0
Scott
Top achievements
Rank 1
answered on 01 Jun 2018, 08:59 PM
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. 
0
Ralitsa
Telerik team
answered on 06 Jun 2018, 02:49 PM
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.
0
Scott
Top achievements
Rank 1
answered on 03 Sep 2018, 06:06 PM

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. 

0
Elena
Telerik team
answered on 05 Sep 2018, 08:42 AM
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.
Tags
Carousel
Asked by
Adam Smith
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Adam Smith
Top achievements
Rank 1
Milan
Telerik team
Scott
Top achievements
Rank 1
Ralitsa
Telerik team
Elena
Telerik team
Share this question
or