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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Docking Manager add new child

Thread ID:

Created:

Updated:

Platform:

Replies:

77486 Nov 3,2008 08:52 PM UTC Dec 7,2009 06:21 AM UTC WPF 8
loading
Tags: Tools
Administrator [Syncfusion]
Asked On November 3, 2008 08:52 PM UTC

Hello,

I have been playing around with the docking manager a little bit, and was wondering if you had any tips for me. My goal is to dynamically add new windows to the docking manager via a drag and drop "toolbox" if you will. This would work very similar to the way the toolbox works in visual studio - drag items from the toolbox over to your docking manager.

There are two major hurdles that I see while implementing this, the first being how to trigger the DockingManager's "drag mode". Is there a way I can drag an item from my toolbox, and as I hover over the syncfusion DockingManager, bring up the dock arrows like you would normally see when dragging items around?

Second, it looks like it will be reasonably difficult to dynamically add items to the right location in my DockingManager. I've taken a peek at the way things seem to be layed out using this sort of syntax:
sftools:DockingManager.SideInDockedMode="Bottom"
but it seems like that might get complicated if I'm trying to programmatically add in new windows.

If anyone has any advice as to how I might accomplish my task, I would be very appreciative!

Thanks,

Shaun



Balavasanth [Syncfusion]
Replied On November 5, 2008 08:42 PM UTC


Hi Shaun,

Thanks for your interests in Syncfusion products.

Displaying DragProvider through programatically is not possible since that is runtime behavior, so the users can drop the dragged item, and it will create as float window, then you can dock it any where in the client area using the mouse. Instead if you need dropped window as a Dock Window kindly make use of the code snippet.

//For dropped window as Dock Window
DockingManager.SetSideInDockedMode(dockPanel, DockSide.Right);
DockingManager.SetState(dockPanel, DockState.Dock);

It is very easy to dynamically add items to the right location in our Docking Manager. And our API's are very user friendly, For instance sftools:DockingManager.SideInDockedMode="Bottom" is the one you have mentioned in your update, which is a simple attached property. Kindly make use of the following code snippet to set the SetSideInDockedMode programmatically.

DockingManager.SetSideInDockedMode(depedencyobject,DockSide.Bottom);

It's very simple when you try to programmatically add new windows in DockingManager.

For your reference we are sending you a simple sample, where we have explained how Docking Manager are added dynamically and dropped window as a Float Window. Kindly download it from the below mentioned location.

http://www.syncfusion.com/support/user/uploads/DockingSampe123-813719387.zip

Please let us know if you have any queries.

Regards,
Bala.


Moon Chung
Replied On February 26, 2009 08:39 PM UTC

I downloaded the sample for the drag & drop. But when I ran it, I noticed that that drag & drop from TreeViewAdv to DockingManager does not do anything. Is there anything that you have to do so that drop can actually happen?

Thanks.
Moon

>
Hi Shaun,

Thanks for your interests in Syncfusion products.

Displaying DragProvider through programatically is not possible since that is runtime behavior, so the users can drop the dragged item, and it will create as float window, then you can dock it any where in the client area using the mouse. Instead if you need dropped window as a Dock Window kindly make use of the code snippet.

//For dropped window as Dock Window
DockingManager.SetSideInDockedMode(dockPanel, DockSide.Right);
DockingManager.SetState(dockPanel, DockState.Dock);

It is very easy to dynamically add items to the right location in our Docking Manager. And our API's are very user friendly, For instance sftools:DockingManager.SideInDockedMode="Bottom" is the one you have mentioned in your update, which is a simple attached property. Kindly make use of the following code snippet to set the SetSideInDockedMode programmatically.

DockingManager.SetSideInDockedMode(depedencyobject,DockSide.Bottom);

It's very simple when you try to programmatically add new windows in DockingManager.

For your reference we are sending you a simple sample, where we have explained how Docking Manager are added dynamically and dropped window as a Float Window. Kindly download it from the below mentioned location.

http://www.syncfusion.com/support/user/uploads/DockingSampe123-813719387.zip

Please let us know if you have any queries.

Regards,
Bala.




Balavasanth [Syncfusion]
Replied On March 2, 2009 06:19 PM UTC

Hi Moon,

Thanks for your interests in Syncfusion products.

We really thank you for diligently following up and bringing this defect to our attention. This has been considered as a breaking issue in our latest version with the Docking Manager. Our developers are working hard on to fixing this issue. The fix for this issue will be available along with our development build on 16th of March 2009. We deeply regret for this inconvenience caused.

Please let us know if you have any queries.

Regards,
Bala.


Administrator [Syncfusion]
Replied On December 1, 2009 12:50 PM UTC

Bala,

I tried the link: http://www.syncfusion.com/support/user/uploads/DockingSampe123-813719387.zip

but got a browser error saying the page cannot be found.

I am also trying to add a new child programmatically, with a DockState of Document. However, when calling DockingManager.SetState, I get a StackOverflow exception. Here is the snippet:

Border myBorder = new Border();
TextBlock myText = new TextBlock();

myBorder.Child = myText;

myText.Text = "this doc just added";

dockingManager.Children.Add(myBorder);
DockingManager.SetDockingManager(myBorder, dockingManager);
DockingManager.SetHeader(myBorder, "header for new doc");
DocumentContainer.SetMDIBounds(myBorder, new Rect(30, 30, 300, 300));
DockingManager.SetState(myBorder, DockState.Document);

Any help or guidance is appreciated.

Chad

Githanjali S [Syncfusion]
Replied On December 2, 2009 12:39 PM UTC

Hi Chad,

Please make sure that you are calling BeginInit and EndInit properly when you add children via code.

For example, below code should work perfectly.

public Window2()
{
InitializeComponent();
this.Loaded += new RoutedEventHandler(Window2_Loaded);
}

void Window2_Loaded(object sender, RoutedEventArgs e)
{
docking.BeginInit();
StackPanel panel = new StackPanel();
docking.Children.Add(panel);
DockingManager.SetState(panel, DockState.Document);
docking.EndInit();
}


Please let me know if you have any queries.

Regards,
Githanjali

Administrator [Syncfusion]
Replied On December 2, 2009 02:22 PM UTC

Githanjali,

When I wrap adding the child with BeginInit & EndInit, I still get the same behavior: a stack overflow on the call to SetState.

If I remove the call to SetState, I do not get a stack overflow.

Chad

Administrator [Syncfusion]
Replied On December 4, 2009 10:43 PM UTC

I think this is a bug. The version is: 7.3.0.20.

The issue occurs when your XAML has an object with SideInDockedMode="Bottom", and another XAML object with DockingManager.State="Document". Where the SideInDockedMode="Bottom" object is declared above the DockingManager.State="Document" within the XAML. And then you add a docuemnt object in code.

If you declare your document object above the bottom object, no stack overflow.

Attached is a project which recreates.

Chad



DynamicAddDockWindow_789c9ea3.zip

Hemanth Kumar K [Syncfusion]
Replied On December 7, 2009 06:21 AM UTC

Hi Chad,

This issue is not reproducible in our latest version, Please install our latest version which is available from the link below.

http://www.syncfusion.com/downloads/latest-version

Unlock key:

If your Essential Studio license is current, you will be able to obtain the key to install this version from
your account in DirectTrac. Otherwise, please contact your Syncfusion Sales Representative or e-mail
salessupport@syncfusion.com.

Please let us know if you have any queries,

Thanks,
HemanthKumar K.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;