Completed
Last Updated: 16 Jan 2015 14:30 by ADMIN
To reproduce: 

Follow these steps:

1. Extract the project I have attached and open it in Visual Studio.
2. Run it.
2a. You should note two docked windows on the left (tabbed).
3. Click on the "Open Next Window" button.  The first two clicks will simple open the first two docking windows (already open)
On the 3rd click another docking window should appear on the right.
Click the button a couple more times.  You should have 3 docked windows on the right.
4. Now, drag the windows on the left so they are floating and docked together.
5. Click on the Save Layout button at the bottom.
6. Close and rerun the sample.
You should note that the floating windows appear at the expected location.  Move them off to the side away from their default location (away from the center of the screen)
So far so good.
7. Upon reopening the application with toolWindow3, 4 and 5 floating and docked close the floating window.
8. Save the layout.
--> This is where the key is...
9. Close and rerun the sample.
If you watch quickly you'll see several windows "flicker".  They appear and disappear quickly.
Now, if you hit the "Open Next Window" button 5x, it will open the first two (already open) and then open the 3rd, 4th and 5th windows.  But NOTE - they are NOT docked together.  They are also not at the location where you left them (remember you needed to move them to the side)


Completed
Last Updated: 20 Oct 2014 14:29 by ADMIN
To reproduce:

Use the following methods which adds host windows to ToolTabStrip and set the ShowItemCloseButton:

private void AddDocumentStrip()
{
    // Create and add a document strip to the dock.
    this.documentstrip = new ToolTabStrip();
    this.documentstrip.TabStripAlignment = TabStripAlignment.Top;
    this.documentstrip.CaptionVisible = false;
    this.documentstrip.ActionMenuButton.Visibility = ElementVisibility.Hidden;
    this.DocumentDock.Controls.Add(documentstrip);
    this.DocumentDock.ShowToolCloseButton = true;
}

private void radCommandBar1_Click(object sender, EventArgs e)
{
    RadForm testdoc = new RadForm();

    // Create a hostwindow to hold the document (so can interact with the dock)
    HostWindow hostwindow = new HostWindow();
    hostwindow.Text = "Document " + DocumentDock.DockWindows.Count.ToString();
    hostwindow.ToolCaptionButtons = ToolStripCaptionButtons.Close;

    // Load the document into the host window
    hostwindow.LoadContent(testdoc);

    // Set the floating size when it is undocked
    Size size = new Size(660, 440);
    hostwindow.DefaultFloatingSize = size;

    // Make sure a closed document releases its resources
    hostwindow.CloseAction = DockWindowCloseAction.CloseAndDispose;

    // Check if we are opening our first document, requires additional setup
    //if (currentdocuments.Count == 0)
    if (DocumentDock.ActiveWindow == null)
    {
        if (this.DocumentDock.Controls.Count < 2)
        {
            this.documentstrip.Controls.Add(hostwindow);
            this.documentstrip.CaptionVisible = true;
            this.DocumentDock.Controls.Add(documentstrip);
            this.DocumentDock.ShowToolCloseButton = true;
        }
        else
        {
            ((ToolTabStrip)this.DocumentDock.Controls[1]).Controls.Add(hostwindow);
            ((ToolTabStrip)this.DocumentDock.Controls[1]).CaptionVisible = true;
            this.DocumentDock.ShowToolCloseButton = true;
        }
    }
    else
    {
        documentstrip.Controls.Add(hostwindow);
        documentstrip.Show();
    }
    this.documentstrip.Text = "Document " + DocumentDock.DockWindows.Count.ToString();

    //Bring Analyzer to the front
    this.Activate();
}


Click the button a few times, close all windows and click again. You will notice that the close button will not be visible in the new windows.

Alternatively, you can download the sample project.

Workaround:

Manually set the ShowItemCloseButton property to each child ToolTabStrip:

private void AddDocumentStrip()
{
    // Create and add a document strip to the dock.
    this.documentstrip = new ToolTabStrip();
    this.documentstrip.TabStripAlignment = TabStripAlignment.Top;
    this.documentstrip.CaptionVisible = false;
    this.documentstrip.ActionMenuButton.Visibility = ElementVisibility.Hidden;
    this.DocumentDock.Controls.Add(documentstrip);
    this.DocumentDock.ShowToolCloseButton = true;
}

private void radCommandBar1_Click(object sender, EventArgs e)
{
    RadForm testdoc = new RadForm();

    // Create a hostwindow to hold the document (so can interact with the dock)
    HostWindow hostwindow = new HostWindow();
    hostwindow.Text = "Document " + DocumentDock.DockWindows.Count.ToString();
    hostwindow.ToolCaptionButtons = ToolStripCaptionButtons.Close;

    // Load the document into the host window
    hostwindow.LoadContent(testdoc);

    // Set the floating size when it is undocked
    Size size = new Size(660, 440);
    hostwindow.DefaultFloatingSize = size;

    // Make sure a closed document releases its resources
    hostwindow.CloseAction = DockWindowCloseAction.CloseAndDispose;

    // Check if we are opening our first document, requires additional setup
    //if (currentdocuments.Count == 0)
    if (DocumentDock.ActiveWindow == null)
    {
        if (this.DocumentDock.Controls.Count < 2)
        {
            this.documentstrip.Controls.Add(hostwindow);
            this.documentstrip.CaptionVisible = true;
            this.DocumentDock.Controls.Add(documentstrip);
            this.DocumentDock.ShowToolCloseButton = true;
        }
        else
        {
            ((ToolTabStrip)this.DocumentDock.Controls[1]).Controls.Add(hostwindow);
            ((ToolTabStrip)this.DocumentDock.Controls[1]).CaptionVisible = true;
            foreach (ToolTabStrip strip in this.DocumentDock.EnumFrameworkControls<ToolTabStrip>())
            {
                strip.ShowItemCloseButton = true;
            }
        }
    }
    else
    {
        documentstrip.Controls.Add(hostwindow);
        documentstrip.Show();
    }
    this.documentstrip.Text = "Document " + DocumentDock.DockWindows.Count.ToString();

    //Bring Analyzer to the front
    this.Activate();
}
Completed
Last Updated: 26 Aug 2014 10:26 by ADMIN
To reproduce:

Add a RadDock to a form and every few seconds remove it and add a new one. You will see that the memory will increase. Apparently RadDock has subscribed to the Resize event of the parent form but does not unsubscribe when disposed.

Workaround:

Unsubscribe from the Resize event of the form prior disposing RadDock:

var ctrl = this.Controls["editor"];
var eventInfo = this.GetType().GetEvent("Resize");
var handlerMethod = typeof(RadDock).GetMethod("parentForm_Resize", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
var eventDelegate = Delegate.CreateDelegate(eventInfo.EventHandlerType, ctrl.Controls["radDock1"], handlerMethod);
eventInfo.RemoveEventHandler(this, eventDelegate);
this.Controls.Remove(ctrl);
ctrl.Dispose();
Completed
Last Updated: 13 Nov 2014 09:20 by ADMIN
To reproduce:
- Add RadDock with some document windows to a blank form.
- Make one widow floating and then remove the dock from the current form Controls collection on a button click.
Completed
Last Updated: 01 Oct 2014 12:15 by ADMIN
To reproduce:

Add a RadDock with ToolWindow, AutoHide the window and open it. You will see that the splitter is big (12px width) and has a black border on the top left corner

Workaround:

Subscribe to the DockStateChanged event to hide the problematic element:

void dock_DockStateChanged(object sender, DockWindowEventArgs e)
{
    if (e.DockWindow.DockState == DockState.AutoHide)
    {
        ((e.DockWindow as ToolWindow).TabStripItem.TabPanel.Parent as AutoHideTabStrip).SplitPanelElement.Children[2].Children[0].Visibility = ElementVisibility.Collapsed;
    }
}
Completed
Last Updated: 01 Oct 2014 12:16 by ADMIN
To reproduce:

Add a RadDock to a form and a ToolWindow and set the ToolCaptionButtons to None. Now start the application and you will see that until you focus the ToolWindow, the buttons will be visible.

Workaround:

Set the ToolCaptionButtons property when the form loads:

void CadHandler_Load(object sender, EventArgs e)
{
    foreach (DockWindow window in this.radDock1.DockWindows)
    {
        window.ToolCaptionButtons = ToolStripCaptionButtons.None;
    }
}
Completed
Last Updated: 25 Jul 2014 12:40 by ADMIN
ADMIN
Created by: George
Comments: 0
Category: Dock
Type: Feature Request
1
When you add a few DocumentWindows to RadDock and you undock one of them to a floating window, then undock another one in the same floating window you will see two tabs. In the main area the selected tab is bolded, the functionality should be the same in the floating windows

For the time being use the following code to manually bold the tabs:

this.RadDock.FloatingWindowCreated += RadDock_FloatingWindowCreated;
...
void RadDock_FloatingWindowCreated(object sender, FloatingWindowEventArgs e)
{
    e.Window.Controls[0].ControlAdded += Form1_ControlAdded;
}

void Form1_ControlAdded(object sender, ControlEventArgs e)
{
    DocumentTabStrip tabStrip = e.Control as DocumentTabStrip;
    tabStrip.ControlAdded -= Form1_ControlAdded;
    if (tabStrip != null)
    {
        tabStrip.SelectedIndexChanged += tabStrip_SelectedIndexChanged;
    }
}

void tabStrip_SelectedIndexChanged(object sender, EventArgs e)
{
    DocumentTabStrip tabStrip = sender as DocumentTabStrip;
    if (tabStrip != null)
    {
        foreach (DocumentWindow item in tabStrip.Controls)
        {
            item.TabStripItem.ResetValue(RadItem.FontProperty, ValueResetFlags.Local);
        }

        tabStrip.SelectedTab.TabStripItem.Font = new Font(tabStrip.SelectedTab.Font.FontFamily, tabStrip.SelectedTab.Font.Size, FontStyle.Bold);
    }
}
Completed
Last Updated: 01 Oct 2014 12:16 by ADMIN
Declined
Last Updated: 04 Feb 2015 13:13 by ADMIN
Workaround:

        void radDock1_DockWindowAdded(object sender, DockWindowEventArgs e)
        {
            DocumentWindow docWin = e.DockWindow as DocumentWindow;

            if (docWin != null && docWin.Text.Contains(Environment.NewLine))
            {
                docWin.TabStripItem.Padding = new Padding(25, 2, 3, 2);
            }
        }
Completed
Last Updated: 15 Jan 2015 17:55 by ADMIN
To reproduce:

Add a few ToolWindows to RadDock and start the application. Drag one window out of the form and dock the others inside of it. Dock the window back to the RadDock. You will notice that only the current window will be docked leaving the rest of the windows floating. The correct behavior is the whole window with its child windows to be docked.

Workaround:

Subscribe to the DockStateChanging and DockStateChanged events and manually add the windows.

private IEnumerable<DockWindow> windows;
void RadDock_DockStateChanging(object sender, DockStateChangingEventArgs e)
{
    if (e.NewWindow.FloatingParent == null)
    {
        this.windows = Enumerable.Empty<DockWindow>();
        return;
    }


    this.windows = DockHelper.GetDockWindows(e.NewWindow.FloatingParent, true, this.RadDock).Where(x => x != e.NewWindow);
}


void RadDock_DockStateChanged(object sender, DockWindowEventArgs e)
{
    foreach (DockWindow window in windows)
    {
        this.RadDock.DockWindow(window, e.DockWindow.DockTabStrip, DockPosition.Fill);
    }
}
Completed
Last Updated: 06 Nov 2014 11:06 by ADMIN
To reproduce:

Add a few document windows to a RadDock. Start the application and start dragging a document window's tab, do not move the mouse much, you want to keep the red cursor. While at it press escape. The drag operation will be canceled. Now move your mouse over the tabs and you will notice that they will be dragged.

Workaround:

When the Drag service stops we need to reset some fields.

public Form1()
{
    InitializeComponent();


    foreach (Control child in ControlHelper.EnumChildControls(this.radDock1, true))
    {
        DocumentTabStrip docStrip = child as DocumentTabStrip;
        if (docStrip != null)
        {
            RadPageViewElement pageViewElement = docStrip.TabStripElement;
            pageViewElement.ItemDragService.Stopping += ItemDragService_Stopping;
            pageViewElement.ItemDragService.Started += ItemDragService_Started;
            break;
        }
    }
}


void ItemDragService_Started(object sender, EventArgs e)
{
    foreach (DockTabStrip strip in DockHelper.GetDockTabStrips<DockTabStrip>(this, true, this.radDock1))
    {
        strip.MouseDown += strip_MouseDown;
        strip.MouseUp += strip_MouseUp;
        strip.MouseCaptureChanged += strip_MouseCaptureChanged;
        strip.MouseMove += strip_MouseMove;
    }
}


void ItemDragService_Stopping(object sender, RadServiceStoppingEventArgs e)
{
    foreach (DockTabStrip strip in DockHelper.GetDockTabStrips<DockTabStrip>(this, true, this.radDock1))
    {
        strip.MouseDown -= strip_MouseDown;
        strip.MouseUp -= strip_MouseUp;
        strip.MouseCaptureChanged -= strip_MouseCaptureChanged;
        strip.MouseMove -= strip_MouseMove;


        strip.GetType().GetMethod("OnMouseCaptureChanged", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).Invoke(strip, new object[] { EventArgs.Empty });
        typeof(TabStripPanel).GetField("dragStart", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(strip, Point.Empty);
    }
}


void strip_MouseMove(object sender, MouseEventArgs e)
{
    if (this.isMouseDown.ContainsKey(sender) && !this.isMouseDown[sender])
    {
        sender.GetType().BaseType.BaseType.GetField("dragging", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(sender, true);
    }
}


Dictionary<object, bool> isMouseDown = new Dictionary<object, bool>();
void strip_MouseCaptureChanged(object sender, EventArgs e)
{
    this.isMouseDown[sender] = false;
}


void strip_MouseUp(object sender, MouseEventArgs e)
{
    this.isMouseDown[sender] = false;
}


void strip_MouseDown(object sender, MouseEventArgs e)
{
    this.isMouseDown[sender] = true;
}

Completed
Last Updated: 12 Feb 2015 08:48 by ADMIN
To reproduce:

Create MDI form using RadDock by following the article: http://www.telerik.com/help/winforms/dock-mdi-mode-automatic-mdi-form-handling.html You will notice that the Closing and Closed events of the MdiForms will not be invoked.

Workaround:

Subscribe to the FormClosing event of the main Form and close all the windows manually:

void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
    this.RadDock.CloseAllWindows();
}
Completed
Last Updated: 28 Oct 2014 15:29 by ADMIN
To reproduce:
- Dock a tool window in a black RadDock.
- Drag and drop the toolwindow in the top, bottom, right or left docking guides in the center.
- The tool window is docked as document window and fills the entire space.

Workaround:
public Form1()
{
    InitializeComponent();
    DragDropService service = this.radDock1.GetService<DragDropService>();

    service.PreviewHitTest += service_PreviewHitTest;
    
    radDock1.DockStateChanged += radDock1_DockStateChanged;
}

void radDock1_DockStateChanged(object sender, DockWindowEventArgs e)
{
    if (dropTarget is DocumentContainer)
    {
        if (position != null && position != "Fill")
        {
            e.DockWindow.DockState = DockState.Docked;
            switch (position)
            {
                case "Top":
                    radDock1.DockWindow(e.DockWindow, DockPosition.Top);
                    break;
                case "Left":
                    radDock1.DockWindow(e.DockWindow, DockPosition.Left);

                    break;
                case "Right":
                    radDock1.DockWindow(e.DockWindow, DockPosition.Right);

                    break;
                case "Bottom":
                    radDock1.DockWindow(e.DockWindow, DockPosition.Bottom);
                    break;
            }
            position = null;
        }
    }
}

string position = null;
object dropTarget = null;

void service_PreviewHitTest(object sender, DragDropHitTestEventArgs e)
{
    if (e.HitTest.GuidePosition != null)
    {
        dropTarget = e.DropTarget;
        position = e.HitTest.DockPosition.Value.ToString();
        Console.WriteLine(e.DropTarget);
    }
}
Declined
Last Updated: 02 May 2014 08:14 by ADMIN
To reproduce:
- Add RadDock to a blank form and dock a tool window to the bottom.
- Add RadRichTextBox to the tool window and set its anchor property to all for sides.
- Save and close the form.
- Reopen the form, you will notice that the RadRichtextBox has different size.

Completed
Last Updated: 15 Jan 2015 18:00 by ADMIN
To reproduce:

Add a ToolWindow to RadDock. AutoHide it:

toolWindow1.AutoHide();

Then Hide it:

toolWindow1.Hide();

And show it:

toolWindow1.Show();

You will see that the window is docked but is not AutoHide

Workaround:

Call the AutoHide method instead of the Show method:

toolWindow1.AutoHide();
Approved
Last Updated: 15 Aug 2017 09:45 by ADMIN
Use cases:

1. You have a MainDocumentContainer with Document windows in it, placed in one under the other. Setting the DockState of the bottom DocumentWindow to Hidden, and restoring it afterwards, should place the DocumentWindow at the same place, instead of merging it with the above one

2. Same layout as above, when the layout is saved and then restored, the DocumentWindow positions should be exactly as they were
Declined
Last Updated: 13 Dec 2014 15:44 by ADMIN
DECLINED: the issue is in the client's code.

To reproduce:

- add a dock with some windows

- save the layout with this code: 

           var stringWriter = new StringWriter();
           radDock1.SaveToXml(stringWriter);
           savedLayoutString = stringWriter.ToString(); //with this line you can save the same stream to a file and observe that it is saved with UTF-16

- load the layout with the following code:
            using (var stream = new MemoryStream())
            {
                var streamWriter = new StreamWriter(stream);
                streamWriter.Write(savedLayoutString);
                streamWriter.Flush();
                stream.Position = 0;
                radDock1.LoadFromXml(stream);
            }

Workaround - when reading the xml, replace utf-16 with utf-8
                 streamWriter.Write(File.ReadAllText("qqq.xml").Replace("utf-16", "utf-8"));
           

Completed
Last Updated: 20 Jun 2014 15:00 by ADMIN
To reproduce:
1.Add a RadDock with a ToolWindow and a DocumentWindow. Add several controls to all windows. Use the following code:


protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    if (System.IO.File.Exists(@"..\..\..\layoutTest.xml"))
        this.radDock1.LoadFromXml(@"..\..\..\layoutTest.xml");
}


protected override void OnClosing(CancelEventArgs e)
{
    this.radDock1.SaveToXml(@"..\..\..\layoutTest.xml");
    base.OnClosing(e);
}


2. Run the application and change the current layout. 
3. Close the form and run the application again. The controls which belong to the RadDock's DocumentWindow disappear from the dialog.

Workaround:
class MyDock : RadDock
{
    protected override void LoadFromXmlCore(System.Xml.XmlReader reader, bool oldXmlFormat)
    {
        //stop the base logic
        //base.LoadFromXmlCore(reader, oldXmlFormat);
 
        if (reader == null)
        {
            return;
        }
 
        this.ActiveWindow = null;
 
        FieldInfo prevActiveWindow = typeof(RadDock).GetField("prevActiveWindow", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.GetField);
        prevActiveWindow.SetValue(this, null); //this.prevActiveWindow = null;
 
        FieldInfo attachedWindows = typeof(RadDock).GetField("attachedWindows", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
        SortedList<string, DockWindow> _attachedWindows = attachedWindows.GetValue(this) as SortedList<string, DockWindow>;
        MethodInfo CleanAutoHideTabs = typeof(RadDock).GetMethod("CleanAutoHideTabs", System.Reflection.BindingFlags.NonPublic | BindingFlags.Instance);
        CleanAutoHideTabs.Invoke(this, new object[] { _attachedWindows.Values, true }); //this.CleanAutoHideTabs(this.attachedWindows.Values, true);
 
        MethodInfo ResetDesiredDockState = typeof(RadDock).GetMethod("ResetDesiredDockState", System.Reflection.BindingFlags.NonPublic | BindingFlags.Instance);
        ResetDesiredDockState.Invoke(this, null); //this.ResetDesiredDockState();
 
        MethodInfo OnLoadingFromXML = this.DocumentManager.GetType().GetMethod("OnLoadingFromXML", System.Reflection.BindingFlags.NonPublic | BindingFlags.Instance);
        OnLoadingFromXML.Invoke(this.DocumentManager, null); //this.DocumentManager.OnLoadingFromXML();
 
        if (oldXmlFormat)
        {
            this.BeginTransactionBlock(false);
 
            MethodInfo LoadFromOldXml = typeof(RadDock).GetMethod("LoadFromOldXml", System.Reflection.BindingFlags.NonPublic | BindingFlags.Instance);
            LoadFromOldXml.Invoke(this, new object[] {reader}); // this.LoadFromOldXml(reader);
 
            this.EndTransactionBlock();
        }
        else
        {
            MethodInfo LoadFromNewXml = typeof(RadDock).GetMethod("LoadFromNewXml", System.Reflection.BindingFlags.NonPublic |  BindingFlags.Instance);
            LoadFromNewXml.Invoke(this, new object[] { reader }); // this.LoadFromNewXml(reader);
        }
 
        this.EnsureInitialized();
        this.OnLoadedFromXml();
    }
 
    public override string ThemeClassName
    {
        get
        {
            return typeof(RadDock).FullName;
        }
    }
}
Completed
Last Updated: 01 Jul 2014 09:44 by ADMIN
To reproduce:
- Add RadDock with couple of tool windows to a blank form
- Subscribe to the ActiveWindowChanged event.
- Run the application and close all windows in the dock.
- You will notice that the despite that the ActiveWindow property is set to null the event is not fired. 
Completed
Last Updated: 01 Jul 2014 09:37 by Kurt
To reproduce:

Add a RadDock and two ToolWindows with many controls inside (~100). Drag out the one toolwindow and dock it back by dragging. Now drag it out again and dock it by clicking in its title bar and clicking Docked. You will notice that the second way is faster.