ToolWindow Tag Problem

2 posts, 0 answers
  1. Ozcan Oksuz
    Ozcan Oksuz avatar
    9 posts
    Member since:
    Feb 2010

    Posted 16 Apr 2010 Link to this post

    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

     

     

     

     

     

     

     

     

     

     

  2. Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 19 Apr 2010 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top