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

Scrolling question..

8 Answers 264 Views
PageView
This is a migrated thread and some comments may be shown as answers.
thomas
Top achievements
Rank 1
thomas asked on 29 Nov 2017, 04:32 PM

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!

8 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 30 Nov 2017, 12:37 PM
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.
0
thomas
Top achievements
Rank 1
answered on 30 Nov 2017, 04:22 PM

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

0
Hristo
Telerik team
answered on 01 Dec 2017, 04:12 PM
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.
0
thomas
Top achievements
Rank 1
answered on 04 Dec 2017, 05:07 PM

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

0
Hristo
Telerik team
answered on 06 Dec 2017, 02:03 PM
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.
0
thomas
Top achievements
Rank 1
answered on 06 Dec 2017, 03:42 PM

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

0
thomas
Top achievements
Rank 1
answered on 06 Dec 2017, 04:16 PM

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

0
Hristo
Telerik team
answered on 07 Dec 2017, 01:54 PM
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.
Tags
PageView
Asked by
thomas
Top achievements
Rank 1
Answers by
Hristo
Telerik team
thomas
Top achievements
Rank 1
Share this question
or