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

How to custom style of verticalscroll with RadPageViewPage?

2 Answers 185 Views
PageView
This is a migrated thread and some comments may be shown as answers.
jiang
Top achievements
Rank 1
jiang asked on 06 May 2020, 09:15 AM

Hello!

I'm using RadPageView in my app. In my code I set the AutoScroll property.

foreach( RadPageViewPage page in radPageView2.Pages)  
            {  
                page.AutoScroll = true;  
            }  

The scroll axis is displayed as shown in the attached file, I want to custom style of verticalscroll ;for example, scroll background color, thumb background color,height. 

But, I couldn't find a way to get scrollbarElement to set style. What should I do?

Your reply is appreciated.

2 Answers, 1 is accepted

Sort by
0
jiang
Top achievements
Rank 1
answered on 06 May 2020, 09:18 AM
I forgot to mention that RadPageView selects strip mode.
0
Nadya | Tech Support Engineer
Telerik team
answered on 07 May 2020, 09:16 AM

Hello Jiang,

I would like to note that the AutoScroll property that you set is an inherited property and it enables showing of the standard MS ScrollableControl which is within the RadPageViewPage. I would recommend you to replace the standard ScrollableControl with a RadScrollablePanel on each page of RadPageView. You can just drag it from the Toolbox and drop it in the RadPageViewPage, then set its Dock property to Fill. Thus, if you place a control which bounds exceed the panel, the respective scrollbar will be shown. 

Please refer to the following code snippet that demonstrates how you can customize the respective scrollbar that is shown:

//size
this.radScrollablePanel1.VerticalScrollbar.ScrollBarElement.MaxSize = new Size(18, 0);
//backcolor
var scrollFill = this.radScrollablePanel1.VerticalScrollbar.ScrollBarElement.Children[1] as FillPrimitive;
scrollFill.BackColor = Color.Violet;
//thumb backcolor
this.radScrollablePanel1.VerticalScrollbar.ScrollBarElement.ThumbElement.ThumbFill.BackColor = Color.Yellow;   this.radScrollablePanel1.VerticalScrollbar.ScrollBarElement.ThumbElement.ThumbFill.GradientStyle = GradientStyles.Solid;

I hope this helps. If you need further assistance do not hesitate to contact me.

Regards,
Nadya
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
PageView
Asked by
jiang
Top achievements
Rank 1
Answers by
jiang
Top achievements
Rank 1
Nadya | Tech Support Engineer
Telerik team
Share this question
or