According to the provided screenshot, it seems that two of the ToolWindows
are arranged vertically. This will calculate wrong width per window since these two windows share the same width but their height is twice smaller. There is not automatic API for handling this case and to be honest it wouldn't b easy at all to determine this.
Note that RadDock
is actually a derivative of RadSplitContainer
which hosts all windows in split panels. The split panel that contains the two vertically oriented ToolWindows
actually contains another nested RadSplitContainer
which contains two items in the Controls
collection. Knowing this arrangement of the panels, you may iterate the RadDock.SplitPanels
collection recursively in depth and see if there are any nested RadSplitContainers
that host more than one ToolWindow
. In general, to calculate the proper width per window, you need to know the total width of RadDock
and the number of ToolWindows
among which you need to distribute the width.
However, have in mind that it would probably require a lot of conditions and checks for the windows arrangement and after moving a window or redocking it to a new place, new split panels will be created in RadDock
to host the window at its new position. This is a quite complex layout and it is performed over the current size of RadDock
. That is why I would suggest you to think about the SplitPanelSizeMode.Relative
where you can specify RelativeRatio
. Then, whenever the size of RadDock
changes, you can reset the sizing mode and assign a new ratio in order to calculate automatically the size. Additional information is available in the following help article: https://docs.telerik.com/devtools/winforms/controls/dock/object-model/example-building-an-advanced-layout-at-runtime
I hope this information helps.
Dess | Tech Support Engineer, Sr.
Get quickly onboarded and successful
with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.