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

The "best" scroll-able layout.

1 Answer 170 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Artem
Top achievements
Rank 1
Artem asked on 08 Jul 2012, 11:03 AM
Hi, Telerik team.
I browsed few examples and forum posts, have experimented a bit, but had no luck to clarify this topic for myself.
Building an application with tool windows I have some issues with resizing those windows and seeing the tools in them.
Please, if you can help me - I will be very happy.

I know that I am going to ask quite basic things, so If you know where can I read about those things - let me know.

So, I have Telerik.WinControls.UI.Docking.ToolWindow named toolWindow
and I have MyUserControl userControl placed right into toolWindow
I want my userControl to be at list 400*200 pixels always, e.g. its MinimumSize = 400,200

My requested behavior is appearance of scroll bars if I resize toolWindow under those limits. 

I have discovered that the following things have influence on this issue:
1) Structure of user control itself. If it has scrollable panel inside or not, if controls inner container is docked to fill or anchored somehow.
2) Whether I place control right into window or I place scrollable panel into window before control.

I am quite lost in options and properties and cannot define the rules. Can you tell me how it should be done in the right way? Some pattern perhaps.

Thank you in advance, regards.

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 11 Jul 2012, 12:46 PM
Hi Artem,

Thank you for writing.

The easiest way to have scroll bars in this case is to put a RadScrollablePanel docked Fill in the ToolWindow and then add your UserControl in this panel. Here is a sample:
public Form1()
       {
           InitializeComponent();
 
           ToolWindow tw = new ToolWindow();
           radDock1.DockWindow(tw, DockPosition.Left);
 
           RadScrollablePanel sPanel = new RadScrollablePanel();
           sPanel.Dock = DockStyle.Fill;
           sPanel.Controls.Add(new UserControl1());
 
           tw.Controls.Add(sPanel);
       }

Let me know if you have any other questions.
 
Regards,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
Dock
Asked by
Artem
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or