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

DockPanel size issue

7 Answers 142 Views
Dock
This is a migrated thread and some comments may be shown as answers.
DONG JIN LEE
Top achievements
Rank 1
DONG JIN LEE asked on 04 Jul 2007, 01:00 AM
Hello.
1. I want to create same size of 8 DockPanels at once. I tried to it using PreferredDockSize, but I couldn't control the size.
2. I need to ailgn DockPanels like Windows Tile alignment

Please let me know how to handle it.

7 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 04 Jul 2007, 08:49 AM
Hello DONG,

you can use the Advanced Layout Designer to rearrange DockPanel in design time. When the layout is created dynamically in run-time, you can use following code snippet:

DockPanel panel1 = new DockPanel(); 
dockingManager1.SetDock(panel1, DockPosition.Left); 
 
DockPanel panel2 = new DockPanel(); 
dockingManager1.SetDock(panel2, DockPosition.Left); 
 
DockPanel panel3 = new DockPanel(); 
dockingManager1.SetDock(panel3, panel1, DockPosition.Bottom); 
 
DockPanel panel4 = new DockPanel(); 
dockingManager1.SetDock(panel4, panel2, DockPosition.Bottom); 
 
DockPanel panel5 = new DockPanel(); 
dockingManager1.SetDock(panel5, panel1, DockPosition.Bottom); 
 
DockPanel panel6 = new DockPanel(); 
dockingManager1.SetDock(panel6, panel2, DockPosition.Bottom); 
 
DockPanel panel7 = new DockPanel(); 
dockingManager1.SetDock(panel7, panel3, DockPosition.Bottom); 
 
DockPanel panel8 = new DockPanel(); 
dockingManager1.SetDock(panel8, panel4, DockPosition.Bottom); 



All the best,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
DONG JIN LEE
Top achievements
Rank 1
answered on 04 Jul 2007, 10:43 AM
Hello.Julian
Thank you for quick response.
I have more questions about docpanel size.

1. The code was fine for even number docpandels. When it apply at odd number docpandels, it was not woking. Could you tell me how can I align odd number docpanels in run-time?

2. I added a new docpandel in run-time at left using PreferredDockSize property. But, it seemed not working.
If I wrote code:
    panel.PreferredDockSize = (100, this.Height);
I expected the panel will created as 100 pixel width. But it has always same size whether I define the size or not.
How can I force a size for a new one?
0
Julian Benkov
Telerik team
answered on 04 Jul 2007, 04:30 PM
Hi DONG,

When we have odd number of dockpanels, or want to change the size, we should calculate the size of the docking manager from the size of all panels and set it  directly using the Size property:

private void Form3_Shown(object sender, EventArgs e)  
{  
    DockPanel panel1 = new DockPanel();  
    dockingManager1.SetDock(panel1, DockPosition.Left);  
      
    DockPanel panel2 = new DockPanel();  
    dockingManager1.SetDock(panel2, DockPosition.Right);  
 
    panel3 = new DockPanel();  
    dockingManager1.SetDock(panel3, DockPosition.Right);  
 
    int width = dockingManager1.Size.Width / 3;  
    panel1.Size = new Size(width, panel1.Height);  
    panel2.Size = new Size(width, panel2.Height);  
    panel3.Size = new Size(width, panel3.Height);  



All the best,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
DONG JIN LEE
Top achievements
Rank 1
answered on 05 Jul 2007, 01:23 AM
Hi. Julian
I couldn't control the size using your code.The docs are not created expected size.Approximary the size of the first doc is 1/4 of docmanager, the second doc is also 1/4 and the thrid is 1/2.
The docs are created always the size whether I use the Size property or not. 

0
Julian Benkov
Telerik team
answered on 05 Jul 2007, 07:22 AM
Hi DONG,

Please open a support ticket and send us your application so that we can review your exact implementation. It seems that we are missing something from your scenario and your application will hep us provide you with the appropriate solution. Thanks in advance.


Greetings,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
bute
Top achievements
Rank 1
answered on 03 Jan 2008, 01:42 AM
We are having similar problems controlling height.  Please let us know if there is a fix for this!!! : )

Thanks,
GBute
0
Julian Benkov
Telerik team
answered on 03 Jan 2008, 12:30 PM
Hello Gary,

Thank you for writing.

We have found issues related to the layout operation after changing the size from the Width or Height properties of DockPanel. These will be addressed in our upcoming release. Please use the Size property of DockPanel for the resizing operation.

If you have any additional questions, please contact us.

Regards,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Dock
Asked by
DONG JIN LEE
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
DONG JIN LEE
Top achievements
Rank 1
bute
Top achievements
Rank 1
Share this question
or