DockPanel size issue

8 posts, 0 answers
  1. DONG JIN LEE
    DONG JIN LEE avatar
    4 posts
    Member since:
    Jun 2007

    Posted 03 Jul 2007 Link to this post

    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.
  2. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 04 Jul 2007 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. DONG JIN LEE
    DONG JIN LEE avatar
    4 posts
    Member since:
    Jun 2007

    Posted 04 Jul 2007 Link to this post

    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?
  5. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 04 Jul 2007 Link to this post

    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
  6. DONG JIN LEE
    DONG JIN LEE avatar
    4 posts
    Member since:
    Jun 2007

    Posted 04 Jul 2007 Link to this post

    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. 

  7. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 05 Jul 2007 Link to this post

    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
  8. bute
    bute avatar
    10 posts
    Member since:
    Aug 2007

    Posted 02 Jan 2008 Link to this post

    We are having similar problems controlling height.  Please let us know if there is a fix for this!!! : )

    Thanks,
    GBute
  9. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 03 Jan 2008 Link to this post

    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
Back to Top
UI for WinForms is Visual Studio 2017 Ready