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

RadScrollablePanel Scrollbar issues

5 Answers 753 Views
ScrollablePanel
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 15 Jan 2019, 02:39 PM

Hello there,
I have some question about working with RadScrollablePanel.

Sometimes the RadScrollablePanel does not correctly display the scrollbars. For example, I use RadLabel bounded by width of RadScrollablePanel (using the dynamically changeable MaximumSize property). 
I noticed that the vertical scrollbar does not always appear if the height of RadLabel and height of RadScrollablePanel.DisplayRectangle differ by about 10 pixels (at 96 DPI and Segoe UI 8.25pt font). This is clearly seen in example 1.
If we change width of RadScrollablePanel by a few pixels, we will see a different picture. A vertical scrollbar will be displayed on the screen and everything will look like it’s supposed to be. Keep in mind that the height of the elements remains unchanged. This is seen in example 2.
But that's not all. If we change the RadForm size a little more again, then we will see that the vertical scrollbar disappeared from the screen again; however, it's marked as Visible = True and if we take the focus on RadScrollablePanel, we can scroll the content using mouse wheel for example. This is seen in example 3.

Example 1: https://c2n.me/3ZabLEg
Example 2: https://c2n.me/3Zaclrf
Example 3: https://c2n.me/3ZacJol

At first sight, this may seem like a minor bug. However, considering that RadForms (or another container) with a fixed size can be used, and the text itself can change dynamically during operation, this bug causes problems with displaying information for users.
What guidelines can you give to work with RadScrollablePanel to prevent this bug?
Below I attach project with example. Please change extension from JPG to ZIP. 

I use Telerik 2018.3.1016.20 with .Net 3.5 on Win7

Best regards. 

5 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 16 Jan 2019, 02:16 PM
Hi Jeremy,

The scrollable panel internally uses a container which is a System.Windows.Forms.Panel and our scrollbars are synced with the scrollbars of the panel. You can achieve the desired behavior by changing the AutoScrollMargin property of the standard panel: 
this.radScrollablePanel1.AutoScrollMargin = new Size(1, 1);

I hope this will help. Let me know if you need further assistance.

Regards,
Hristo
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.
0
Jeremy
Top achievements
Rank 1
answered on 24 Jan 2019, 04:16 PM

Hello there, I spent some time trying your solution and finally found working one.

radScrollablePanel1.AutoScrollMargin = new Size(radScrollablePanel1.VerticalScrollbar.Size.Width, radScrollablePanel1.HorizontalScrollbar.Size.Height);

If AutoScrollMargin  is 1,1  or any other size except exact size of ScrollBar (or multiply of it) I see same issues as before and even more on High DPI. I attach project without the fix with AutoScrollMargin  = 1,1.

First issue

If you click on label on 100% DPI, you will see the issue, I believe it yours, not Microsoft's. Form will shrink, you will be able to scroll txt with mouse, scrollbar will have Visible=true, but won't be actually displayed. 

First issue happens when height is constant, width is big enough to avoid scrolling, and then you step by step reducing ONLY  width with small steps (5px).

Second issue

On HDPI the project will finally hang in cyclic resize events. 

Hanging happens when scrollbar need to be shown or hidden, so you need to jump over that critical size in both directions.

Third issue

Also on HDPI scrollbar will be show only when two lines of text are hidden, if only one line of text is hidden - scrollbar not shown. 

For reproduce you need to set size big enough to avoid scrollbars, and start reducing height with small steps. 

Solution 

If I set AutoScrollMargin to size of scrollbar or 2x, 3x of it, it will work almost perfect. If it is at least one pixel bigger or smaller - all issues comes back, just in different size. 

I fell like it can be big issue overall, since it uses some basic code for calculating sizes, and can be used as internal component of other controls. I tried to subscribe to all possible resize events of ScrollablePanel and ScrollablePanelContainter, it doesn't solve issues. So at the moment the problem has workaround, but please consider some more time in deeper looking into it. 

0
Hristo
Telerik team
answered on 25 Jan 2019, 12:34 PM
Hello Jeremy,

Thank you for the update. I am glad that you have managed to find a suitable solution. I will also share your input with the rest of the team. It might be hard to actually find a clean solution as we are relying on the standard scrollbars. Yet if we manage to find one, I will update the thread.

Regards,
Hristo
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.
0
jamsheer
Top achievements
Rank 1
Veteran
answered on 08 Apr 2021, 10:11 AM

hi Teelerik

I am using here table layoutpanel in a radscrollablepanel, its working fine , But there shaking when scrolling the panel

can I get a solution  for this 

I attached a gif file for reffer

regarding 

Jamsheer

0
Nadya | Tech Support Engineer
Telerik team
answered on 08 Apr 2021, 02:34 PM

Hello, jamsheer,

Considering the provided gif file only is not enough to replicate the issue. Indeed, RadScrollablePanel internally hosts the standard MS ScrollableControl. However, without replicating the problem I can not determine what causes it on your end. Could you please elaborate? Can you specify the exact steps on how to reproduce the problem? Feel free to submit a support ticket from your Telerik account with additional information and a runnable sample project demonstrating the undesired behavior. Thus, our support engineers will be able to investigate the case precisely and gladly assist you.

Looking forward to your reply.

Regards,
Nadya
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
ScrollablePanel
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Jeremy
Top achievements
Rank 1
jamsheer
Top achievements
Rank 1
Veteran
Nadya | Tech Support Engineer
Telerik team
Share this question
or