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

ToolWindow Tag Problem

3 Answers 75 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Ozcan Oksuz
Top achievements
Rank 1
Ozcan Oksuz asked on 16 Apr 2010, 09:50 AM
Hello,

I am trying to keep an object in the Tag property of a tool window.
But when I dock the tool window to a position the tag property becomes null.

  

 

ToolWindow window = new ToolWindow();   
_documentTabStrip.Controls.Add(window);  
window.Tag = "Tag";  // Here I assign a tag   
_radDock.DockControl(window, DockPosition.Top, DockType.ToolWindow);  
// The Tag property of the docked toolwindow is null (_radDock.ToolWindows[0].Tag is null)  
 

Is there any way to find the docked window in the _radDock to set its Tag.
Please help.
Burhan Eyimaya

 

 

 

 

 

 

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 19 Apr 2010, 04:46 PM
Hi Ozcan Oksuz,

Thank you for contacting us.

When using:
 
_radDock.DockControl(window, DockPosition.Top, DockType.ToolWindow);
 
you wrap the window (ToolWindow instance) in a HostWindow. To access its Tag you could use the code:
 
object tag = ((HostWindow)(_radDock.DockWindows.ToolWindows[0])).Content.Tag;
 
Here Content is your instance of ToolWindow.

For the specific case of using ToolWindow we recommend using the DockWindow method of RadDock:
 
_radDock.DockWindow(window, DockPosition.Top);
 
In this case you can access the Tag of the window with the code:
 
object tag = _radDock.DockWindows.ToolWindows[0].Tag;

Hope it helps.

Regards,
Alexander
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Manoj
Top achievements
Rank 1
answered on 20 Feb 2017, 06:13 AM

Hi

I want to set the Unique ID property for Tool window as like below  can you please provide me specific solutions.

Me.DocumentExplorerDockPanel.ID = New System.Guid("e4a0db3d-615d-46e5-9aca-3889ff200a49")

So unable to bind this id to our Guid please suggest.

Thanks Manoj

0
Hristo
Telerik team
answered on 20 Feb 2017, 07:32 AM
Hi Manoj,

Thank you for writing.

The tool windows of RadDock do not expose an ID property. If it fits your local setup you can use the Tag property of the windows for your purpose.

An alternative approach is to inherit the ToolWindow class and extend it with an ID property. Please note you will need to manually change the type of all custom tool windows added in the Visual Studio designer. I am sending you attached a sample project demonstrating the suggested solution.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Dock
Asked by
Ozcan Oksuz
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Manoj
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or