Scrolling question..

9 posts, 0 answers
  1. thomas
    thomas avatar
    5 posts
    Member since:
    Jul 2017

    Posted 29 Nov 2017 Link to this post

    Hi guys,

     

    I'm writing an application in vb.net 2017, using Backstage within RadPageView, and am running into an issue..

    So, I'm using a 27" touch screen monitor, and have essentially added so many pages that I now need scroll buttons.

    Well, the scroll buttons that are available as elements in the toolstrip are so tiny, that I won't be able to really use them with a touch screen.

    My question is this: how can I go about making those scroll buttons bigger? If that's not possible, what code can I use if I add two bigger command buttons, in order to get a scroll up/scroll down function?

    Also, I've never used gestures before (never worked with a touch screen app before!) - is there an easy way to somehow get it to smoothly scroll by swiping your finger up/down?

     

    Sorry if there are a lot of questions here, I just can't seem to figure it out!

    Thank you!

  2. Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 30 Nov 2017 Link to this post

    Hello Thomas,

    Thank you for writing.

    You can access the strip buttons and increase their MinSize: 
    Telerik.WinControls.UI.RadPageViewBackstageElement strip = this.radPageView1.ViewElement as RadPageViewBackstageElement;
    strip.StripButtons = StripViewButtons.Scroll;
     
    strip.ItemContainer.ButtonsPanel.ScrollLeftButton.MinSize = new Size(40, 40);
    strip.ItemContainer.ButtonsPanel.ScrollRightButton.MinSize = new Size(40, 40);

    Since the buttons would be increased you may also consider using bigger images and you can set them via the Image property. Scrolling in the page view is controlled by the arrow keys or the buttons. If you enable the gestures in the control you can handle the PanGesture event and then scroll the element holding the strip items. To scroll the items you can use the perform click method exposed by the scroll buttons.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo
    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. thomas
    thomas avatar
    5 posts
    Member since:
    Jul 2017

    Posted 30 Nov 2017 Link to this post

    Hi Hristo,

     

    Thank you very much for taking the time to reply to me!

    I don't want to sound like a total idiot - but where do I put that code into my program? Is that in C#?

    Also, if I manually add my own buttons/images, am I able to invoke the scrolling up/down functions through them? ie: if I add a giant up arrow/down arrow, can I add code to the command_click event and have it do what the StripButtons do? I would honestly prefer that route, that way I can move the buttons to a better location on the gui.

     

    Thank you again,

    Thomas

  4. Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 01 Dec 2017 Link to this post

    Hi Thomas,

    Thank you for writing back.

    You can add the code I previously posted in the form`s constructor just after the InitializeComponent call: 
    public RadForm1()
    {
        InitializeComponent();
         
        Telerik.WinControls.UI.RadPageViewBackstageElement strip = this.radPageView1.ViewElement as RadPageViewBackstageElement;
        strip.StripButtons = StripViewButtons.Scroll;
        strip.ItemContainer.ButtonsPanel.ScrollLeftButton.MinSize = new Size(40, 40);
        strip.ItemContainer.ButtonsPanel.ScrollRightButton.MinSize = new Size(40, 40);
    }

    About your other question, the items can be scrolled by calling the PerformClick method of the buttons. You can do this programmatically when you need to and according to your local setup. The gestures are also working so you could also handle the PanGesture.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo
    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. thomas
    thomas avatar
    5 posts
    Member since:
    Jul 2017

    Posted 04 Dec 2017 Link to this post

    Hi Hristo,
    Thank you again for replying back to me, I appreciate the help.
    The code that you've given me is in C# and I cannot use it in VB.net. I have converted the code and have *somewhat* got it working, but if I make any visual changes in designer, it reverts back to the original sized buttons. Are you able to give me that code in the correct VB.net format, please?
    While searching around, I've found this code snipper (in C# again,) that one of you guys had replied to another user about scrolling via the mouse wheel; is there any way that I can adapt this to CommandButton_Click ? I can't seem to get it to work..

    public Form1()
    {
        InitializeComponent();
        this.radPageView1.MouseWheel += new MouseEventHandler(radPageView1_MouseWheel);
        ((RadPageViewBackstageElement)radPageView1.ViewElement).StripButtons = StripViewButtons.Scroll;          
    }
      
    void radPageView1_MouseWheel(object sender, MouseEventArgs e)
    {
        if (e.Delta > 0)
        {
            ((RadPageViewBackstageElement)radPageView1.ViewElement).ItemContainer.ButtonsPanel.ScrollLeftButton.PerformClick();
        }
        else
        {
            ((RadPageViewBackstageElement)radPageView1.ViewElement).ItemContainer.ButtonsPanel.ScrollRightButton.PerformClick();
        }
    }

    How do I use the radPageView1.ViewElement,RadPageViewBackstageElement.ItemContainer.ButtonsPanel.ScrollLeftButton.PerformClick()
    function in a command button? I see the ScrollLeftButton.PerformClick, I just don't know how to use it/call it. :(

    I apologize for all of the questions, I'm just kinda' stuck.

    Thank you,

    Thomas

  6. Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 06 Dec 2017 Link to this post

    Hello Thomas,

    You can access the elements added to the button`s panel and call their PerformClick method. I am sending you attached a sample project demonstrating the discussed approach. Additionally, you can find attached a short video demonstrating the result on my end.

    I hope this helps. Let me know if you have other questions.

    Regards,
    Hristo
    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.
  7. thomas
    thomas avatar
    5 posts
    Member since:
    Jul 2017

    Posted 06 Dec 2017 in reply to Hristo Link to this post

    Hello Hristo,

    Woohoo, that's perfect - thank you so much!

    My problem was that when you said "InitializeComponent()," I was literally going to Private Sub InitializeComponent()  (You know, the one that says "NOTE: The following procedure is required, blah blah blah DON'T MODIFY lol) within the Form itself *slams face into keyboard*

    So yeah, I appreciate all of the patience and help that you've given me! Now I'm trying to figure out how to do the exact same thing with the auto-scrollbar with a splitcontainer/splitpanel. One of these days I'll become more fluent with this stuff lol

     

    Thanks again,

    Thomas

  8. thomas
    thomas avatar
    5 posts
    Member since:
    Jul 2017

    Posted 06 Dec 2017 in reply to thomas Link to this post

    Sorry for the double-post, but I can't edit my last one.
    I figured out how to get the auto scrollbars to move via buttons within a splitpanel.

    Thanks again! :)

    Thomas

  9. Hristo
    Admin
    Hristo avatar
    1508 posts

    Posted 07 Dec 2017 Link to this post

    Hi Thomas,

    Thank you for the updated.

    As I understand you are having your project working as expected. I am glad that I managed to help.

    Let me know if you have other questions.

    Regards,
    Hristo
    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