Panorama smooth scrolling

6 posts, 0 answers
  1. next
    next avatar
    3 posts
    Member since:
    Jan 2018

    Posted 22 Jan 2018 Link to this post

    Hi. 
    With radPanorama I have the option of a smooth scroll (simulation of scroll with a gesture) to desired element from the code?
    Thank you.
  2. Dimitar
    Admin
    Dimitar avatar
    2807 posts

    Posted 23 Jan 2018 Link to this post

    Hello,

    You can use a timer and increase the scroll value:
    Timer scrollTimer = new Timer();
     
    public RadForm1()
    {
        InitializeComponent();
    ;
        scrollTimer.Interval = 30;
        scrollTimer.Tick += ScrollTimer_Tick;
    }
     
    private void ScrollTimer_Tick(object sender, EventArgs e)
    {
        var value = radPanorama1.PanoramaElement.ScrollBar.Value;
        if (value + 10 < radPanorama1.PanoramaElement.ScrollBar.Maximum)
        {
            radPanorama1.PanoramaElement.ScrollBar.Value += 10;
            if (radPanorama1.Items[30].ControlBoundingRectangle.X < 0 )//this will scroll to item 31
            {
                scrollTimer.Stop();
            }
        }
        else
        {
            scrollTimer.Stop();
        }
    }
     
    private void radButton1_Click(object sender, EventArgs e)
    {
        scrollTimer.Start();
    }

    I hope this will be useful. Let me know if you have additional questions.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. next
    next avatar
    3 posts
    Member since:
    Jan 2018

    Posted 23 Jan 2018 in reply to Dimitar Link to this post

    Thank you very much for fast answers, and for code example. :) 
    First of all you use Winforms timer (very not accurate and have troubles when start\stop\change in not GUI threads)
    So, no way to do something like
    ScrollTo(tileElement, 1000)
    where 1000 it is speed (time taken) for scroll?

    I trying ScrollView(value)  with small amounts of scroll... All blinks and looks very sloppy.
    My scenario of usage - some kind of photo library. Photos coming from external source. After some time of inactivity I need scroll to "last tile" each time when new tile added.  And I want to it smoothly. :)
    Looks like Telerik radPanorama it best solution... If we can do smooth scrolling to selected tile element it will be really best solution. Thank you in advance.


  4. Dimitar
    Admin
    Dimitar avatar
    2807 posts

    Posted 23 Jan 2018 Link to this post

    Hi,

    The scrolling looks pretty smooth on my side with regular tiles. How large are the images on your side? How many images do you have?

    Another control that you can use for this is RadCarousel. You can check the examples in the demo application as well. See attached video.

    I am looking forward to your reply.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  5. next
    next avatar
    3 posts
    Member since:
    Jan 2018

    Posted 23 Jan 2018 in reply to Dimitar Link to this post

    I'm surprised with the quality of support.
    Thank you. 
    I try to use your approach and write report.
    I use +\-1500 photos. Before create tiles I create preview images with size of tiles (approximately 400x250+ according to screen and panorama size (4 row as usual)) and assign Image property with this preview images.
  6. Dimitar
    Admin
    Dimitar avatar
    2807 posts

    Posted 24 Jan 2018 Link to this post

    Hi,

    The panorama is not designed to work with such amount of data. In this case, you can use RadListView which supports UI Virtualization. This way the performance will not depend on the items count. You can achieve a similar layout as well. I have attached an updated version of the project that shows this.

    Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top