number of controls docked in Doc panel

4 posts, 0 answers
  1. Sasmita
    Sasmita avatar
    19 posts
    Member since:
    Jul 2008

    Posted 22 Jul 2008 Link to this post

    Hi ,

    I have one docked panel on a docking manager. On button click I am docking forms to the doc panel.  At a given point of time I want to know how many forms are docked in the doc panel. 

    I tried with dockingManager1.ActiveControl, dockingManager1.GetManagedDockables (), dockingManager1.Controls it did not help.

    Could you please help me knowing the procedure for knowing it ?

    Thanks,
    Sasmita

     

  2. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 24 Jul 2008 Link to this post

    Hi Sasmita,

    The dockingManager1.GetManagedDockables () method will return you all IDockable windows hosted in RadDock. If you want to get only TabbedDocuments created in DockingManager you can use its Documents property.

    Please send us a simple example describing the details of your scenario. Thank you in advance.

    All the best,
    Julian Benkov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Sasmita
    Sasmita avatar
    19 posts
    Member since:
    Jul 2008

    Posted 31 Jul 2008 Link to this post

    Hi,

    Dockmanager.Document property does not retrive me anything. Count is coming as null.

    I have an indows application. I am using a dock manager which is having a Dock panel. There is a button called "Open Window". Each time i click on Open window, i create one instance of a User Control and docks it in the DockPanel.

    For the first time when i click the button, it creates one instance of the user control and docks it at the Top and for all subsequest  click,  it creates instance of the User Controls and Docks just below the first window.

    My Requirement is if for the First time i have clicked on the "Open Window" and one instance is docked in the Dock manager then next time when i click the button the nect window should not be docked below it, it should be floating..
    So for that i need to know how many user controls are docked corrently in the Dock Manager. 
    dockingManager1.DockingSites Property gives me the List, but if i close the instances also, it retains the list.

    So is there any way i can know whether any control is docked or not in docking manager.

    Any kind of help is appreciated.

    Sasmita



  5. Angel
    Admin
    Angel avatar
    121 posts

    Posted 04 Aug 2008 Link to this post

    Hello Sasmita,

    Use GetManagedDockables (DockState).Count to get the number of added and docked panels.
    A sample code is given below:

    DockPanel dp = new DockPanel();     
    // Add your user control in dp.Controls  
     
    this.dockingManager1.SetDock(dp, DockPosition.Top);  
    if (this.dockingManager1.GetManagedDockables(DockState.Docked).Count > 1)  
    {  
        Point pos = this.dockingManager1.PointToScreen(Point.Empty);  
        pos.Offset(100, 40);  
        this.dockingManager1.Float(dp, pos, this.dockingManager1.Size);  

    All dock panels after the first one will be floating. Manage the position of the floating form at your will - it is in screen coordinates.

    Note that when closing a DockPanel it is not released (disposed). It is just hidden and later it can be shown.
    If you wish to close and dispose the user controls - handle the DockingStateChanged event and remove the given dock object:

    private void dockingManager1_DockingStateChanged(object sender, DockingChangedEventArgs e)  
    {  
        if (e.DockState == DockState.Hidden)  
        {  
            this.dockingManager1.Remove(e.DockObject);  
        }  

    I hope this clarifies the case. Don't hesitate to contact us if you have other questions.

    All the best,
    Angel
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top