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

Telerik setting RadButtonTag to null

1 Answer 6 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Hugues
Top achievements
Rank 1
Hugues asked on 29 Jan 2015, 09:56 PM
documentWindow1.CloseAction = Telerik.WinControls.UI.Docking.DockWindowCloseAction.Hide;
SplitPanelElement e = documentWindow1.TabStrip.SplitPanelElement;
DockLayoutPanel panel = e.Children[3] as DockLayoutPanel;
RadButtonElement ee = panel.Children[0] as RadButtonElement;
ee.Tag = new RadButtonElement();
ee.Click+=ee_Click;

Whenever the click event of the close button in DocumentWindow is called Tag is null. The same thing happens when you Hide and Show the documentwindow as well. It seems like Telerik is actually destroying the document instead of hiding it.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 03 Feb 2015, 11:58 AM
Hello Hugues,

Thank you for contacting us.

When a DockWindow has its CloseAction property set to Hide, this window is only closed (hidden) in RadDock. However, this window is not detached from its RadDock and you can manage it from the RadDock collections.

Note that RadDock arranges its windows by using a split container. Hence, when you have several DocumentWindows and close one of themthe close button is still visible on the RadDock as the SplitPanelElement is still displayed. But when you close the last DocumentWindow the SplitPanelElement is removed. Afterwards, if you show the hidden DocumentWindows, a new SplitPanelElement is created. As a result, a new close button is created. That is why its Tag property is reset. You can check the hashcode of the DocumentWindow in order to confirm that the window is exactly the same.

RadDock introduces the PageViewInstanceCreated event, which is fired when a new pageview instance is created to display the DocumentWindows. In the DockStateChanged event you can get the new SplitPanelElement and subscribe to the new close button's Click event.

I hope this information helps. Should you have further questions, I would be glad to help.

Regards,
Dess
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Dock
Asked by
Hugues
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or