Hiding & Showing Right-docked Toolwindows

7 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
    1404 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. UI for WinForms is Visual Studio 2017 Ready
  4. 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.

  5. 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...

  6. Dimitar
    Admin
    Dimitar avatar
    1404 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
  7. 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 :)

  8. Dimitar
    Admin
    Dimitar avatar
    1404 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
Back to Top
UI for WinForms is Visual Studio 2017 Ready