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

control init position

4 Answers 145 Views
Docking
This is a migrated thread and some comments may be shown as answers.
omer
Top achievements
Rank 1
omer asked on 04 Feb 2014, 10:43 AM
i;m trying to open a control that it will fill the dockinmanager in  the center
i have the following code:

            RadSplitContainer container = new RadSplitContainer();
            container.InitialPosition = DockState.DockedRight;
            RadDocking.SetDockState(container, DockState.DockedRight);
            m_dockingManager.Items.Add(container);
            RadPaneGroup group = new RadPaneGroup();
            container.Items.Add(group);
            RadPane newPane = new RadPane();
            group.AddItem(newPane, global::Telerik.Windows.Controls.Docking.DockPosition.Center);
            RadDocking.SetSerializationTag(newPane, control.Name);
            newPane.Title = ps.Caption;
            newPane.Content = control;
            newPane.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
            newPane.Arrange(new Rect(control.DesiredSize));
            newPane.ClipToBounds = true;
            newPane.CanUserClose = ps.CloseButtonVisability;
            newPane.CanUserPin = ps.AutoHideVisability;
            newPane.CanDockInDocumentHost = (ps.FloatOnly == false);
            if (ps.FloatOnly == true)
                newPane.MakeFloatingOnly();
            else
            {
                if (ps.Floating == true)
                    newPane.MakeFloatingDockable();
                else
                    newPane.MakeDockable();
            }
            ResourceDictionary dic = GetTelerikResourceStyle();
            newPane.Style =(Style)dic[DEFAULTRADPANESTYLE];
but this doesnt work- it always open the control in 24 width and heigth in the top left corner of the screen.
why?????





4 Answers, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 07 Feb 2014, 09:54 AM
Hello,

We are not sure what the issue exactly is.

Could you describe to us in more details the expected behavior when adding a Pane via the code behind.

Does the Pane itself needs to be centered and if yes should it be in the DocumentHost or simply docked in the control, or does its content needs to be positioned?

Regards,
Vladi
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

0
omer
Top achievements
Rank 1
answered on 09 Feb 2014, 09:42 AM
Hi,
The pane itself needs to be centered and filled in the docking pane, it doesnt need to be documenthost only docked.
the best way to explain is that it should appear is if i'm dragging a window toward the middle tab  of the rad docking IDE, causing the window to be centered and filling entire pane.
thats how i want my window to be initillized.

but what ever i do the window is opend in the lefst corener with width and heigth dimention of 24.
0
Vladi
Telerik team
answered on 10 Feb 2014, 12:31 PM
Hi,

Achieving the desired behavior depends if or not there is an DocumentHost in the RadDocking control. If there is no DocumentHost in the control and the HasDocumentHost property is set to False, simply adding the SplitContainer to the Items of the control will make that Pane centered and stretched. If the HasDocumentHost i set to True (its default value) you will need to add the newly created Pane to the SplitContainer that is placed inside the DocumentHost.

I recorded a short video showing how to achieve both described scenarios, hope this is helpful. You can also find the sample project attached to my response.

Regards,
Vladi
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

0
omer
Top achievements
Rank 1
answered on 11 Feb 2014, 02:57 PM
Hi Vladi
Thanks for the replay it did help me.
Tags
Docking
Asked by
omer
Top achievements
Rank 1
Answers by
Vladi
Telerik team
omer
Top achievements
Rank 1
Share this question
or