Telerik setting RadButtonTag to null

2 posts, 0 answers
  1. Hugues
    Hugues avatar
    54 posts
    Member since:
    Sep 2014

    Posted 29 Jan 2015 Link to this post

    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.
  2. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 03 Feb 2015 Link to this post

    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.

     
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top