The expected behavior should be similar to Visual Studio, once a maximized floating window starts being dragged it should go to a normal state so that the window under it is visible. How to reproduce: just maximize a floating window, then start dragging it from the title bar, the docking guides will appear which do not help much since the window is still maximized. Workaround: handle the Starting event of the DragDropService and change the WindowState of the window public partial class Form1 : Form { public Form1() { InitializeComponent(); DragDropService service = this.radDock1.GetService<DragDropService>(); service.Starting += Service_Starting; } private void Service_Starting(object sender, StateServiceStartingEventArgs e) { FloatingWindow fw = e.Context as FloatingWindow; if (fw != null && fw.WindowState == FormWindowState.Maximized) { fw.WindowState = FormWindowState.Normal; fw.Location = new Point(Cursor.Position.X - fw.Size.Width / 2, Cursor.Position.Y); } } }
When a document tab is already current, if the user clicks and holds the mouse button on the this tab label, the sibling tab is brought to the front and overlays it visually, so the corners of tab2 obscure the edges of tab1.
This property should be inherited by all tool, document, floating and autohide windows.
To reproduce: please refer to the attached sample project and follow the steps illustrated in the gif file. Workaround: after loading the layout, set the MaximumSize for the FloatingWindow: public RadForm1() { InitializeComponent(); this.radDock1.FloatingWindowCreated += radDock1_FloatingWindowCreated; } Size lastSize = Size.Empty; private void radDock1_FloatingWindowCreated(object sender, Telerik.WinControls.UI.Docking.FloatingWindowEventArgs e) { lastSize= e.Window.Size; } private void button1_Click(object sender, EventArgs e) { int reps; if (!int.TryParse(radMaskedEditBox1.Text, out reps)) { MessageBox.Show(this, "Enter a valid number for repititions."); return; } using (var dockLayout = new MemoryStream()) { for (int i = 0; i < reps; i++) { dockLayout.SetLength(0); radDock1.SaveToXml(dockLayout); radDock1.LoadFromXml(dockLayout); foreach (Telerik.WinControls.UI.Docking.FloatingWindow fw in this.radDock1.ActiveFloatingWindows) { fw.MaximumSize = lastSize; } } } }
Workrarund: If possible create tool-windows with added user controls public static ContentUserControl CreateContentUserControl(RadDock dock) { ContentUserControl uc = new ContentUserControl(); if (dock != null) { ToolWindow hostWindow = new ToolWindow("ContentUserControl"); hostWindow.Controls.Add(uc); hostWindow.Name = uc.Name; dock.FloatWindow(hostWindow); } return uc; }
Use attached to reproduce. Tested on Windows 10 (1607 and 1703) Workaround: RadControl.EnableDpiScaling = False
Use the attached project to reproduce. Workaround: radDock1.DocumentManager.BoldActiveDocument = false;
To reproduce: - Set the font of the tool window: ((ToolTabStrip)this.toolWindow1.TabStrip).CaptionElement.Font = font1; - Make the tool window floating and then dock it again. - The font is not preserved. Workaround: Set the font in the DockStateChanged event.
Workaround: ContextMenuService menuService = this.radDock1.GetService<ContextMenuService>(); menuService.ContextMenuDisplaying += menuService_ContextMenuDisplaying; private void menuService_ContextMenuDisplaying(object sender, ContextMenuDisplayingEventArgs e) { foreach (RadMenuItem listMenuItem in e.MenuItems) { TextPrimitive textPrimitive = listMenuItem.Layout.TextPanel.Children[0] as TextPrimitive; textPrimitive.UseMnemonic = false; } }
To reproduce: Open the attached project and press Ctrl+ Tab in the first text box. Since the textboxes are accepting the Tab, Ctrl + Tab should move to the other control. Workaround // RadTextBox private void TextBoxItem_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if ((e.KeyData & Keys.Tab) == Keys.Tab && (e.KeyData & Keys.Control) == Keys.Control) { e.IsInputKey = true; var item = sender as RadTextBoxItem; this.SelectNextControl(item.HostedControl, true, true, true, true); } } //RadTextBoxControl private void RadTextBoxControl1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if ((e.KeyData & Keys.Tab) == Keys.Tab && (e.KeyData & Keys.Control) == Keys.Control) { e.IsInputKey = true; this.SelectNextControl(sender as RadTextBoxControl, true, true, true, true); } }
If you drag a regular form to the top of the screen it will be maximized. This should work with the floating window as well.
How to reproduce: try resizing a too window using its splitter Workaround: create a custom RadDock using special layout strategy public class MyRadDock : RadDock { public override string ThemeClassName { get { return typeof(RadDock).FullName; } } protected override SplitContainerLayoutStrategy CreateLayoutStrategy() { MySplitContainerLayoutStrategy strategy = null; if (this.LayoutStrategyType != null) { try { strategy = Activator.CreateInstance(this.LayoutStrategyType) as MySplitContainerLayoutStrategy; } catch { strategy = null; } } if (strategy == null) { strategy = new MySplitContainerLayoutStrategy(); } strategy.RootContainerType = typeof(RadDock); return strategy; } } public class MySplitContainerLayoutStrategy : SplitContainerLayoutStrategy { protected override void Measure() { SplitContainerLayoutInfo layoutInfo = (SplitContainerLayoutInfo)typeof(SplitContainerLayoutStrategy).GetField("layoutInfo", BindingFlags.Instance | BindingFlags.NonPublic). GetValue(this); SplitPanel fillPanel = (SplitPanel)typeof(SplitContainerLayoutInfo).GetField("fillPanel", BindingFlags.Instance | BindingFlags.NonPublic). GetValue(layoutInfo); if (fillPanel == null) { base.Measure(); } this.MeasureWithFillPanel(); typeof(SplitContainerLayoutStrategy).GetMethod("ClampMeasuredLength", BindingFlags.Instance | BindingFlags.NonPublic). Invoke(this, new object[] { }); } private void MeasureWithFillPanel() { FieldInfo layoutInfoFi = typeof(SplitContainerLayoutStrategy).GetField("layoutInfo", BindingFlags.Instance | BindingFlags.NonPublic); SplitContainerLayoutInfo layoutInfo = (SplitContainerLayoutInfo)layoutInfoFi.GetValue(this); int availableLength = (int)typeof(SplitContainerLayoutInfo).GetField("availableLength", BindingFlags.Instance | BindingFlags.NonPublic). GetValue(layoutInfo); int remaining = availableLength; SplitPanel panel; //calculate the desired size of all non-fill panels int desiredNonFillLength = 0; List<SplitPanel> layoutTargets = (List<SplitPanel>)typeof(SplitContainerLayoutInfo).GetField("layoutTargets", BindingFlags.Instance | BindingFlags.NonPublic). GetValue(layoutInfo); SplitPanel fillPanel = (SplitPanel)typeof(SplitContainerLayoutInfo).GetField("fillPanel", BindingFlags.Instance | BindingFlags.NonPublic). GetValue(layoutInfo); int count = layoutTargets.Count; for (int i = 0; i < count; i++) { panel = layoutTargets[i]; if (panel == fillPanel) { continue; } desiredNonFillLength += this.GetLength(panel.SizeInfo.AbsoluteSize); } SplitPanelSizeInfo fillInfo = fillPanel.SizeInfo; int totalSplitterLength = (int)typeof(SplitContainerLayoutInfo).GetField("totalSplitterLength", BindingFlags.Instance | BindingFlags.NonPublic). GetValue(layoutInfo); int layoutableLength = availableLength - totalSplitterLength; int correction = 0; int totalMinLength = (int)typeof(SplitContainerLayoutInfo).GetField("totalMinLength", BindingFlags.Instance | BindingFlags.NonPublic). GetValue(layoutInfo); int desiredFillLength = totalMinLength; if (desiredNonFillLength + desiredFillLength > layoutableLength) { correction = (desiredNonFillLength + desiredFillLength) - layoutableLength; } int remainingCorrection = correction; for (int i = 0; i < layoutTargets.Count; i++) { panel = layoutTargets[i]; if (panel == fillPanel) { continue; } int length = this.GetLength(TelerikDpiHelper.ScaleSize(panel.SizeInfo.AbsoluteSize, new SizeF(1f / panel.SplitPanelElement.DpiScaleFactor.Width, 1f / panel.SplitPanelElement.DpiScaleFactor.Height))); if (remainingCorrection > 0 && panel.SizeInfo.SizeMode != SplitPanelSizeMode.Absolute) { float factor = (float)length / desiredNonFillLength; int panelCorrection = Math.Max(1, (int)(factor * correction)); remainingCorrection -= panelCorrection; length -= panelCorrection; } panel.SizeInfo.MeasuredLength = length; int splitterLength = (int)typeof(SplitContainerLayoutInfo).GetField("splitterLength", BindingFlags.Instance | BindingFlags.NonPublic). GetValue(layoutInfo); remaining -= (panel.SizeInfo.MeasuredLength + splitterLength); } fillPanel.SizeInfo.MeasuredLength = remaining; } }
Please refer to the attached sample project. Click the "show" button to open a new MDI child form. Then, press the "close" button. In the Output tab you will notice that the FormClosing/FormClosed events are fired twice. Workaround: use the RadDock's DockWindowClosing and DockWindowClosed events.
How to reproduce: check the attached project and video. Workaround: persist the auto-hidden windows separately public partial class Form1 : Form { public Form1() { InitializeComponent(); this.radDock1.AutoHideWindowDisplaying += RadDock1_AutoHideWindowDisplaying; //Wworkaround this.radDock1.LoadedFromXml += RadDock1_LoadedFromXml; } private void RadDock1_LoadedFromXml(object sender, EventArgs e) { string res = File.ReadAllText(@"..\..\auto-hidden.txt"); foreach (DockWindow window in this.radDock1.GetWindows(typeof(ToolWindow), typeof(HostWindow))) { if (res.IndexOf(window.Name) != -1) { window.DockState = DockState.AutoHide; } } } private void RadDock1_AutoHideWindowDisplaying(object sender, Telerik.WinControls.UI.Docking.AutoHideWindowDisplayingEventArgs e) { } private void button1_Click(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); foreach (DockWindow window in this.radDock1.GetWindows(typeof(ToolWindow), typeof(HostWindow))) { if (window.DockState == DockState.AutoHide) { sb.AppendLine(window.Name); } } File.WriteAllText(@"..\..\auto-hidden.txt", sb.ToString()); this.radDock1.SaveToXml(@"..\..\layout.xml"); } private void button2_Click(object sender, EventArgs e) { this.radDock1.LoadFromXml(@"..\..\layout.xml"); } }
To reproduce: - Auto-hide some windows to the left. - Save the layout - Load the layout - The auto-hide popup is shown.
Please refer to the attached sample project and follow the steps in the gif file. The issue appears when the ToolWindow DockState is set to auto-hide for the firs time as well.
To reproduce: Use the approach here: http://docs.telerik.com/devtools/winforms/dock/object-model/customizing-floating-windows Workaround: private void RadDock1_FloatingWindowCreated(object sender, Telerik.WinControls.UI.Docking.FloatingWindowEventArgs e) { e.Window = new MyWindow(radDock1); e.Window.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable; } class MyWindow : FloatingWindow { public MyWindow(RadDock dock): base(dock) { } protected override CreateParams CreateParams { get { CreateParams cp = base.CreateParams; cp.Style |= NativeMethods.WS_THICKFRAME; return cp; } } }
How to reproduce: 1. Run the attached project 2. Float a tool window 3. Save layout 4. Close the application and start it again 5. Load the saved layout 6. Hide the floating tool window 7. Save layout 8. Close the application and start it again 9. Load layout Notice that the hidden tool window would be floating Workaround: Manually store the hidden tool windows and restore their state after your load the layout: public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void radButton1_Click(object sender, EventArgs e) { this.radDock1.SaveToXml(@"..\..\layout.xml"); StringBuilder sb = new StringBuilder(); foreach (DockWindow window in this.radDock1.DockWindows.GetWindows(DockState.Hidden)) { if (window is ToolWindow) { sb.Append(window.Name); sb.Append(";"); } } File.WriteAllText(@"..\..\hidden.txt", sb.ToString()); } private void radButton2_Click(object sender, EventArgs e) { this.radDock1.LoadFromXml(@"..\..\layout.xml"); string[] windows = File.ReadAllText(@"..\..\hidden.txt").Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); foreach (var window in windows) { this.radDock1.GetWindow<ToolWindow>(window).Hide(); } } }
To reproduce: open the attached sample project. 1. Drag the documentwindow1 as floating 2. Select tool window 2 3. Select the floating documentwindow1. The ActiveWindowChanging event will be fired twice.
To reproduce: - Set the DPI scaling to 150% - Add document window at runtime, their text property should be bound to the TextProperty of an underlying custom control. - This works fine with 100% Workaround: Explicitly update the window text prior adding it to the RadDock.