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

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

6 Answers 68 Views
Dock
This is a migrated thread and some comments may be shown as answers.
bute
Top achievements
Rank 1
bute asked on 03 Jan 2008, 02:44 AM
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

6 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 03 Jan 2008, 12:22 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.

Please use
Regards,
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, 06:06 PM
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;

}

}

}



0
Julian Benkov
Telerik team
answered on 04 Jan 2008, 05:11 PM
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
0
bute
Top achievements
Rank 1
answered on 07 Jan 2008, 05:53 PM
Hi Julian, wow, makes perfect sense!  We were doing on the fly as we built them...Will give this one a try.

Thanks!
Gary
0
bute
Top achievements
Rank 1
answered on 08 Jan 2008, 02:51 AM
Not to belabor the point...but this should work for UserDockControl, as well as DockPanel?

Gary
0
Julian Benkov
Telerik team
answered on 09 Jan 2008, 09:20 AM
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
Tags
Dock
Asked by
bute
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
bute
Top achievements
Rank 1
Share this question
or