Hiding & Showing Right-docked Toolwindows

10 posts, 0 answers
  1. Ryan
    Ryan avatar
    35 posts
    Member since:
    Jul 2015

    Posted 30 Nov 2015 Link to this post

    Hello,

     

    I have a toolwindow that is docked to to a tooltabstrip on the right side of my raddock (this is the only toolwindow on this particular tooltabstrip) in the designer. I need to hide this toolwindow and show it again in the same place. However, both of these code snippets cause the toolwindow to be moved to the tooltabstrip that is docked on the left side of the raddock:

    RadDock1.AutoHideWindows(New DockWindow() {tw}, AutoHidePosition.Right)

    and

    tw.AutoHide()

     
    I heard that once you hide the last toolwindow on a tooltabstrip, the tooltabstrip is disposed, so I set 

    tw.CloseAction = DockWindowCloseAction.Hide

    but this did not help.

     

    If I just call 

    tw.Show()

    the toolwindow will automatically dock to the right side, and when I click the 'Auto Hide' button, the toolwindow is "minimized" and added to a tooltabstrip on the right side. How can I accomplish this behavior programatically?

     

    Thanks in advance!

  2. Dimitar
    Admin
    Dimitar avatar
    2937 posts

    Posted 01 Dec 2015 Link to this post

    Hello Ryan,

    Thank you for writing.

    You can just set the DockState:
    Partial Public Class RadForm1
        Inherits Telerik.WinControls.UI.RadForm
     
        Private tw As New ToolWindow()
        Public Sub New()
            InitializeComponent()
            tw.CloseAction = DockWindowCloseAction.Hide
            radDock1.DockWindow(tw, DockPosition.Right)
            radDock1.AutoHideWindows(New DockWindow() { tw }, AutoHidePosition.Right)
        End Sub
     
        Private Sub radButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
            tw.DockState = DockState.AutoHide
     
        End Sub
     
        Private Sub radButton2_Click(ByVal sender As Object, ByVal e As EventArgs)
            tw.DockState = DockState.Docked
        End Sub
    End Class

    Please let me know if there is something else I can help you with. 
     
    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Ryan
    Ryan avatar
    35 posts
    Member since:
    Jul 2015

    Posted 02 Dec 2015 in reply to Dimitar Link to this post

    Hi Dimitar,

    Thanks for your prompt response! I think I was a little unclear in my initial explanation, but I managed to work it out. I actually wanted to hide the toolwindow in its entirety (not just dock it) and then make it reappear. I worked around this using the following code (is this creating multiple instances of the same toolwindow?):

    Partial Public Class RadForm1
        Inherits Telerik.WinControls.UI.RadForm
      
        Private tw As New ToolWindow()
        Public Sub New()
            InitializeComponent()
            radDock1.DockWindow(tw, DockPosition.Right)
            radDock1.AutoHideWindows(New DockWindow() { tw }, AutoHidePosition.Right)
        End Sub
      
        Private Sub radButton1_Click(ByVal sender As Object, ByVal e As EventArgs)
            radDock1.DockWindow(tw, DockPosition.Right)
            radDock1.AutoHideWindows(New DockWindow() { tw }, AutoHidePosition.Right)
        End Sub
      
        Private Sub radButton2_Click(ByVal sender As Object, ByVal e As EventArgs)
            tw.DockState = DockState.Hidden
        End Sub
    End Class

    Next (unrelated, and I'm not sure if this is even possible), but is there a way to expand the toolwindow to the right, extending the edge of the RadDock? The only way I can think of is by changing it into a floating window and setting it's location programmatically upon click, and then docking it again if the user clicks on anything but the toolwindow.

  4. Ryan
    Ryan avatar
    35 posts
    Member since:
    Jul 2015

    Posted 02 Dec 2015 in reply to Ryan Link to this post

    So I thought this had solved my problem, but the real problem actually turned out to be that I was calling 

    RadDock1.AutoHideWindow(othertw)

    after I set the location of tw. othertw is docked on the left side, and after this was called, the original tw would move from the right side to the left side.

     

    I'm submitting a bug report now - this doesn't seem like the expected behavior to me...

  5. Dimitar
    Admin
    Dimitar avatar
    2937 posts

    Posted 03 Dec 2015 Link to this post

    Hi Ryan,

    Thank you for writing back.

    I noticed your report and I have logged the issue. The item details are located here: FIX. RadRichTextEditor - exception when the imported HTML document contains invalid image source path.

    Do not hesitate to contact us if you have other questions.
     
    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Ryan
    Ryan avatar
    35 posts
    Member since:
    Jul 2015

    Posted 03 Dec 2015 Link to this post

    Dimitar,

    The link you meant to post is here: FIX. RadDock- the AutoHideWindow method changes the position of an already hidden window, just in case anyone else has this same issue :)

  7. Dimitar
    Admin
    Dimitar avatar
    2937 posts

    Posted 04 Dec 2015 Link to this post

    Hello Ryan,

    Yes, I have posted a wrong link, sorry for that.  Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  8. Danny
    Danny avatar
    25 posts
    Member since:
    Oct 2014

    Posted 02 Aug 2019 in reply to Dimitar Link to this post

    Estimado
    y no quiero que sea Docked si no que sea visible como cuando el mouse esta encima del ToolWindows, que poiedad la hace visible ?
    toolGuiaRapida.DockState = DockState.?
  9. Danny
    Danny avatar
    25 posts
    Member since:
    Oct 2014

    Posted 02 Aug 2019 in reply to Dimitar Link to this post

    Dear and I do not want it to be Docked if it is not visible as when the mouse is on the ToolWindows, what kind of visibility makes it visible? toolGuiaRapida.DockState = DockState.?
  10. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4004 posts

    Posted 07 Aug 2019 Link to this post

    Hello, Danny, 

    When a ToolWindow is autohidden (DockState.AutoHide), you can see only a button with the ToolWindow's caption on the right side. Once you hover it, the auto-hide popup is shown. This behavior can be invoked by calling the RadDock.ShowAutoHidePopup method passing the respective ToolWindow as a parameter:

    public RadForm1()
    {
        InitializeComponent();
        this.toolWindow2.DockState = Telerik.WinControls.UI.Docking.DockState.AutoHide;
    }
     
    private void radButton1_Click(object sender, EventArgs e)
    {
        this.radDock1.ShowAutoHidePopup(this.toolWindow2);
    }

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

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top