This is a migrated thread and some comments may be shown as answers.

Open tool window and dragging it, to existing Rad daocking control

3 Answers 84 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Krunal
Top achievements
Rank 1
Krunal asked on 13 Jun 2016, 08:34 AM

Hi,

Currently process works as below
1. On button click, new tool window(created dynamically) opened with content.

private ToolWindow CreateToolWindowPanel(string title)
        {
            var panel = new ToolWindow
            {
                CloseAction = DockWindowCloseAction.Close,
                Text = title + " " + counter++,
                Name = "tw " + counter++,
                ToolCaptionButtons = ToolStripCaptionButtons.Close,
            };
            return panel;
        }

on Button MouseDown following code written

var bounds = new Rectangle(Cursor.Position.X - 30, Cursor.Position.Y - 10, 400, 400);
var panel = CreateToolWindowPanel("pnl");
radDock1.FloatWindow(panel, bounds);

2. After the tool window is shown, User docking it (by dragging) to existing radDaocking control.

 

Requirement for changes in this process is Both step need to be done in single click.

On button click new tool window opened with dragging mode(don't release button click and drag tool window), and docked in existing radDaocking control on release of button click.

Thanks

3 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 13 Jun 2016, 12:30 PM
Hello Krunal,

Thank you for writing.

This operation is not supported. In order to be able to drag the window, you would need to release the button. If you like you can also dock the windows using the DockPosition enumeration. More information is available here: http://docs.telerik.com/devtools/winforms/dock/object-model/creating-toolwindow-and-documentwindow-at-runtime.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms. For more information check out this blog post and share your thoughts.
0
Krunal
Top achievements
Rank 1
answered on 15 Jun 2016, 10:37 AM

I found solution of this scenario as below

 

var svc = radDock1.GetService<DragDropService>();
radDock1.FloatWindow(panel);
svc.Start(panel);

 

And It's works great.

 

0
Hristo
Telerik team
answered on 15 Jun 2016, 12:24 PM
Hi Krunal,

Thank you for writing back.

I think I misunderstood your previous post. Indeed, the solution you shared is a valid approach. If it better fits your local setup you can also handle the MouseDown event and start dragging the window straight after clicking on the button.

I hope this helps. Please let me know if you need further assistance.

Regards,
Hristo Merdjanov
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
Dock
Asked by
Krunal
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Krunal
Top achievements
Rank 1
Share this question
or