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!
9 Answers, 1 is accepted
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.
Dimitar
Telerik
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.
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...
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.
Dimitar
Telerik
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 :)
Yes, I have posted a wrong link, sorry for that. Should you have any other questions do not hesitate to ask.
Regards,
Dimitar
Telerik
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.?
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