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

4 posts, 0 answers
  1. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 13 Jun Link to this post

    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.
  2. Krunal
    Krunal avatar
    4 posts
    Member since:
    Aug 2015

    Posted 13 Jun Link to this post

    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. UI for WinForms is Visual Studio 2017 Ready
  4. Krunal
    Krunal avatar
    4 posts
    Member since:
    Aug 2015

    Posted 15 Jun Link to this post

    I found solution of this scenario as below

     

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

     

    And It's works great.

     

  5. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 15 Jun Link to this post

    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.
Back to Top