Can i control the UserDockControl height, rather than DockManager doing it?

7 posts, 0 answers
  1. bute
    bute avatar
    10 posts
    Member since:
    Aug 2007

    Posted 02 Jan 2008 Link to this post

    Hello,

    I've seen a few threads on being able to control the height of a dockpanel (or in our case a UserDockControl...we've set TdiContainerVisible to true, and then set the Size...but it is not working in Q3 version...??

    Any ideas?

    Thanks,
    Gary
  2. 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.

    Please use
    Regards,
    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. bute
    bute avatar
    10 posts
    Member since:
    Aug 2007

    Posted 03 Jan 2008 Link to this post

    Hello Julian,

    Thank you for the quick reply...We do have one question as to when your upcoming release is supposed to be out?

    As well, i think if i read your reply closely you're implying this ability *will work with our current version (Q3if we use RadPanel (vs. UserDockControl?) and its Size property?  We've tried this as well and it doesn't seem to work either...One of our dev's code snip below opens the first window with the proper height/width...but as soon as you open a second one the Layout Engine seems to take over, and size as it deems...?

    Thanks again...
    Gary

    namespace

    TelerikDockApp

    {

    public partial class Form1 : Form

    {

    static int i = 0;

    static int j = 0;

    public Form1()

    {

    InitializeComponent();

    dockingManager1.TdiContainerVisible =

    true;

    }

    private void button1_Click(object sender, EventArgs e)

    {

    DockPanel panel = CreatePanel("UserControl1_" + (i.ToString()), DockPosition.Top, new Size(100, 100));

    panel.Controls.Add(

    new UserControl1());

    i++;

    }

    private void button2_Click(object sender, EventArgs e)

    {

    DockPanel panel = CreatePanel("UserControl2_" + (j.ToString()), DockPosition.Left, new Size(100, 100));

    panel.Controls.Add(

    new UserControl2());

    j++;

    }

    DockPanel CreatePanel(string caption, DockPosition dokPos, Size size)

    {

    DockPanel panel = new DockPanel();

    panel.Text = caption;

    panel.Size = size;

    panel.PreferredDockSize = size;

    panel.PreferredFloatSize = size;

    this.dockingManager1.SetDock(panel, dokPos);

    return panel;

    }

    }

    }



  5. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 04 Jan 2008 Link to this post

    Hi Gary,

    Thank you for writing.

    When you add DockPanels, the RadDock layout recalculates and resizes windows using criteria such as the position of newly added window, and the size of the current base docking container (target), among others. You may resize a selected DockPanel to the size you desire. Set the Size property of the DockPanel after all the docking panels have been added and docked.

    I hope this was helpful. Contact us again if you have additional questions.

    Sincerely yours,
    Julian Benkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. bute
    bute avatar
    10 posts
    Member since:
    Aug 2007

    Posted 07 Jan 2008 Link to this post

    Hi Julian, wow, makes perfect sense!  We were doing on the fly as we built them...Will give this one a try.

    Thanks!
    Gary
  7. bute
    bute avatar
    10 posts
    Member since:
    Aug 2007

    Posted 07 Jan 2008 Link to this post

    Not to belabor the point...but this should work for UserDockControl, as well as DockPanel?

    Gary
  8. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 09 Jan 2008 Link to this post

    Hello Gary,

    Thank you for writing.

    The issue will be addressed in the Q3 SP1 release. Currently, you may use this override version of the UserDockControl:

    public class MyUserDockControl : UserDockControl  
    {  
        public MyUserDockControl()  
        {  
              
        }  
     
        public new Size Size  
        {  
            get 
            {  
                return base.Size;  
            }  
            set 
            {  
                this.PreferredDockSize = value;  
                base.Size = this.PreferredDockSize;  
            }  
        }  

    If you have any additional questions, please contact me.

    Greetings,
    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