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

Show AutoHidden ToolWindow during runtime

5 Answers 186 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Viktor
Top achievements
Rank 1
Viktor asked on 01 Jul 2011, 08:21 AM
Hello Telerik,

I want to show a ToolWindow which is in Autohide state during runtime. (It should just display not change the DockingState)

I tried ToolWindow.Show(), but the Window isn't shown


How can I do that?

5 Answers, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 06 Jul 2011, 05:04 PM
Hi Viktor,

Thank you for writing.

Consider the following code snippet which achieves your scenario:

ToolWindow toolWindow = new ToolWindow("Tool Window");
this.radDock1.DockWindow(toolWindow, toolWindow, DockPosition.Left);
toolWindow.AutoHide();

I hope this will help you. If you have further questions, I would be glad to help.

 

Kind regards,
Ivan Petrov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Viktor
Top achievements
Rank 1
answered on 07 Jul 2011, 07:43 AM
Hello Ivan,

Thank you for your reply.

This part is working fine, but what about the other way around?

Now showing this Hidden Toolwindow ?

As i told before, i tried Toolwindow.Show() but that doesn't work.

I don't want t change the DockingState, I only want to show the ToolWindow


Regards Viktor
0
Accepted
Ivan Petrov
Telerik team
answered on 13 Jul 2011, 09:49 AM
Hi Viktor,

Thank you for your replay.

From what I understand you want to show a given tool window that is already hidden as if you have hovered it with the mouse. For this scenario you will have to use reflection as the method which is responsible for the showing of a tool window is not public. Please consider the following code snippet:

MethodInfo method = this.radDock1.GetType().GetMethod("ShowAutoHidePopup", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
 
if (method != null)
{
  method.Invoke(this.radDock1, new object[] { this.toolWindow.AutoHideTab, AutoHideDisplayReason.TabItemClicked });
}
In the above snippet this.toolWindow is the tool window you want to show. In my case I have as a field, because I use the code snippet from my previous post to add a tool window to the dock.

I hope this is what you are looking for. Should you have further questions, feel free to contact us.

All the best,
Ivan Petrov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Francois
Top achievements
Rank 1
answered on 07 Feb 2012, 10:09 PM
That code doesn't seem to work anymore with 2011 Q3 SP1, am I wrong?

EDIT: Nevermind ;)
0
Ivan Petrov
Telerik team
answered on 10 Feb 2012, 06:25 PM
Hi Francois,

Thank you for writing.

In case someone else looks for this information, there is now a public ShowAutoHidePopup method which can be used to accomplish this task.

If you have other questions, feel free to write back.

All the best,
Ivan Petrov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Dock
Asked by
Viktor
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Viktor
Top achievements
Rank 1
Francois
Top achievements
Rank 1
Share this question
or