We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Document Mode Tab Questions

Hi

Using the example image can you tell me how to do the following actions programmatically in C#.

The document windows (A1, B1 & C1) have been created using 

DockingManager.SetWindowMode(control, WindowMode.Document);

where control is a standard WinForms UserControl in each case.

1) How would I replace the control "B1" with another control "D1" i.e. assuming the tab is index of B1 is 10 in the DockingManager.ControlsArray property how can I do this 

var D1 = new UserControl() ;

DockingManager.ControlsArray[10] = D1;

The line above just seems to destroy the existing "B1" but doesn't replace it with "D1"

2) How do I programmatically close a tab so the control within the tab gets disposed . I can set the tabs visibility using DockingManager.SetDockVisibility(B1, false) but this doesn't cause the tabs control to get disposed. There doesn't seem to be an API call like DockingManager.CloseTab(B1) that I can find.

3) How do I programmatically change the order of the tabs so that for example the display as B1, A1, C1 instead of A1, B1, C1. Using DockingManager.SetTabPosition doesn't seem to work on DocumentMode tabs and results in either an exception or killing the content of the tab.

Many thanks

Steve 

Untitled.png


1 Reply

HN Harinath Navaneethakrishnan Syncfusion Team December 12, 2022 04:17 PM UTC

Hi Steve,


Sorry for the delay in getting back to you,

Query 2:


You can programmatically close the tab by disabling the docking of the tab. Please refer to the sample and the video for your reference.

Code Snippets:

dockingManager1.SetEnableDocking(panel3, false);

panel3.Dispose();


Query 3:


We have logged a feature request for your requirement “Provide support to rearrange the Document Window” and it can be tracked through our feedback portal below. 


Feedback link: https://www.syncfusion.com/feedback/39734/provide-support-to-rearrange-the-document-window


We will prioritize the features every release based on the demands, and we do not have an immediate plan to implement this since we committed to already planned work. So, this feature will be available for any of our upcoming releases. 


Please cast your vote to make it count and if you have any more specifications/suggestions for the feature request, you can add them as a comment in the feedback portal. 


Query 1:


Once the above feature is implemented, you can replace a tab by removing and inserting items in a specific index.



Regards,

Harinath N


Attachment: DockingManagerDocument_7c99e6ba.zip

Loader.
Live Chat Icon For mobile
Up arrow icon