How to specify the ToolTabStrip when a ToolWindow is docked after floating

2 Answers 191 Views
Dock
Lucy
Top achievements
Rank 1
Lucy asked on 02 Nov 2022, 08:57 AM

We use RadDock.SaveToXml and LoadFromXml to store the current dock state of our WinForms application.

We have a problem that if a user floats a ToolWindow and then reattaches it and then the RadDock SaveToXml is called a new ToolTabStrip appears to be created. This means that when a new ToolWindow is added to the ToolTabStrip (found by name), it is adding the ToolWindow to the wrong ToolTabStrip and the new ToolWindow cannot be seen. 

I am wondering how to fix this and think the best way would be to use an event triggered on re-docking to place the ToolWindow being re-docked in the correct ToolTabStrip. Is there any suggested way to do this or any other solution?

Before floating and re-docking the ToolWindow:

<Telerik.WinControls.UI.Docking.ToolTabStrip SelectedIndex="0" CanUpdateChildIndex="True" Size="200, 994" Location="1, 1" CausesValidation="False" Name="toolTabStrip_Navigation" TabIndex="2" TabStop="False">
      <SizeInfo SplitterCorrection="0, 0" AutoSizeScale="0, 0" />
      <Controls>
        <Telerik.WinControls.UI.Docking.ToolWindow Caption="" AllowedDockState="Docked, Hidden, AutoHide, Floating" PreviousDockState="Docked" Name="twNavigation" Size="192, 960" Location="4, 30" AccessibleDescription="Explorer" AccessibleName="Explorer" Font="Microsoft Sans Serif, 8.25pt" Text="Explorer" />
      </Controls>
    </Telerik.WinControls.UI.Docking.ToolTabStrip>

 

After re-docking the ToolWindow:

 <Telerik.WinControls.UI.Docking.ToolTabStrip SelectedIndex="0" CanUpdateChildIndex="True" Size="200, 994" Location="1, 1" Name="DockTabStrip3" TabIndex="4" TabStop="False">
      <SizeInfo SplitterCorrection="0, 0" AutoSizeScale="0, 0" />
      <Controls>
        <Telerik.WinControls.UI.Docking.ToolWindow Caption="" AllowedDockState="Docked, Hidden, AutoHide, Floating" PreviousDockState="Docked" Name="twNavigation" Size="192, 960" Location="4, 30" AccessibleDescription="Explorer" AccessibleName="Explorer" Font="Microsoft Sans Serif, 8.25pt" Text="Explorer" />
      </Controls>
    </Telerik.WinControls.UI.Docking.ToolTabStrip>
    <Telerik.WinControls.UI.Docking.ToolTabStrip CanUpdateChildIndex="True" Size="200, 994" Location="1, 1" CausesValidation="False" Name="toolTabStrip_Navigation" RightToLeft="No" TabIndex="2" TabStop="False">
      <SizeInfo SplitterCorrection="0, 0" AutoSizeScale="0, 0" />
    </Telerik.WinControls.UI.Docking.ToolTabStrip>

2 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 04 Nov 2022, 10:46 AM

Hello, Lucy,     

When a ToolTabStrip contains several ToolWindows and the user floats one of them, the ToolTabStrip remains existing for the respective position because it has more windows to store. Thus, the user will be allowed to dock the ToolWindow back to its original ToolTabStrip.

However, if the user floats the only one ToolWindow, a floating transaction is executed, as a result of which a FloatingWindow is created and a new ToolTabStrip is also generated. If this ToolWindow is the only one that belongs to the inial ToolTabStrip, this ToolTabStrip will not be present in RadDock anymore. Hence, no ToolTabStrip will be available for the respective position when you want to dock it back.

The observed behavior is expected by design. 

However, if your scenario is different, it would be greatly appreciated if you can provide more details about it and specify what is the exact requirement that you are trying to accomplish. Thus, we would be able to get better understanding of the precise case and provide further assistance. 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Lucy
Top achievements
Rank 1
commented on 04 Nov 2022, 11:22 AM

Hi Dess,

Thank you so much for your reply. Can you see the xml I posted? In the example I give I have one ToolWindow, I float it and re-dock it. When I redock it and call SaveToXml two ToolTabStrips are being exported to XML. Therefore the initialToolTabStrip is still present. In our application users can add open another ToolWindow which is added to the same ToolTabStrip as the first ToolWindow. Currently it is adding it to the intial one that is not used anymore, so it cannot be seen. I need some way around this. 

 

Lucy

Lucy
Top achievements
Rank 1
commented on 08 Nov 2022, 04:41 PM

Hi Dess,

I will raise this as a support ticket, as from what you are saying it is a bug.

Thanks,

Lucy

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 09 Nov 2022, 07:33 AM

Hi, Lucy,

You can find below my findings after investigating the case with saving/loading the layout:

1. Initially docked ToolWindow to the left. The top RadTextBox shows the saved layout:

2. Float the ToolWindow, the bottom RadTextBox shows the saved layout:

3. Dock the ToolWindow back to the left:

Usually, the purpose of storing the previous ToolTabStrip is to have the possibility to restore back to the previous state of window at the proper place after saving/loading functionality is performed. The below gif file illustrates what I mean: 

Note that RadDock offers the DockWindow method allowing you to dock a certain window the a specific position where it is possible to pass a target window as well.

I have attached my sample project for your reference. In case the default behavior conflicts the expected logic in your scenario, it would be greatly appreciated if you can specify in details what changes I need to perform in the project to replicate the problem you are facing. Thus, we would be able to make an adequate analysis of the precise case and provide further assistance. Thank you in advance.

I am looking forward to your reply.

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Lucy
Top achievements
Rank 1
commented on 09 Nov 2022, 11:42 AM

Hi Dess,

Thanks. I misunderstood your first reply when you said that the original ToolTabStrip will not be present in the RadDock anymore.  In our example and your example above, the original ToolTabStrip is still in the XML, so I suppose it still exists but not in the RadDock. We add other Tool Windows programmatically, specifically to the ToolTabStrip with the name of the original ToolTabStrip. Therefore, once the ToolWindow has been floated and redocked they are being added to the old ToolTabStrip which is no longer in the RadDock.

I think I have worked out a solution using DockWindow to add new ToolWindows to same ToolTabStrip as existing ToolWindows if they are docked and dock them with no target if they are floated.

Thanks

Lucy

Dess | Tech Support Engineer, Principal
Telerik team
commented on 11 Nov 2022, 02:52 PM

Hi, Lucy,

I am glad that the DockWindow method that I previously suggested fits the requirements you have. This is the appropriate way to follow when docking windows programmatically instead of finding ToolTabStrips by name. Should you have further questions please let me know.

Tags
Dock
Asked by
Lucy
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or