control init position

5 posts, 0 answers
  1. omer
    omer avatar
    4 posts
    Member since:
    Feb 2014

    Posted 04 Feb 2014 Link to this post

    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?????





  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 07 Feb 2014 Link to this post

    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).

  3. UI for WPF is Visual Studio 2017 Ready
  4. omer
    omer avatar
    4 posts
    Member since:
    Feb 2014

    Posted 09 Feb 2014 in reply to Vladi Link to this post

    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.
  5. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 10 Feb 2014 Link to this post

    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).

  6. omer
    omer avatar
    4 posts
    Member since:
    Feb 2014

    Posted 11 Feb 2014 in reply to Vladi Link to this post

    Hi Vladi
    Thanks for the replay it did help me.
Back to Top
UI for WPF is Visual Studio 2017 Ready