Dock Tabbing

3 posts, 0 answers
  1. brucevb
    brucevb avatar
    4 posts
    Member since:
    Jul 2006

    Posted 28 Nov 2006 Link to this post

    Hello,
    Two questions:

    1) How do you merge in code two dock panels so they are tabbed together?

    2) Is it possible to assign a graphic to the Dock Tabs ? ( next service pack?)

    Thanks!!

    Bruce Van Buren

    Hello,
    Two questions:
     
  2. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 28 Nov 2006 Link to this post

    Hello Bruce,

    1. There are no bitmaps at the moment that could be placed on the tabs, but this feature is to be introduced in Q4
    2. Here is a demo code snippet:

      // new dock panel
      DockPanel panel = new DockPanel();

      // we name the panel
      panel.Text =
      "Test1";

      //we dock the new panel using an existing docked panel as a pivot.
      dockingManager1.SetDock(panel, dockPanel1,
      DockPosition.Fill);
       
    All the best,
    Dimitar Kapitanov
    the telerik team
  3. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 28 Nov 2006 Link to this post

    Hello Bruce,

    Here's additional information regarding your question how to assign images to the tab items in r.a.d.dock.
    You can try and use the following method to do so until we implement this feature in the next release.

    void SetIcon(Bitmap img, DockPanel panel)
    {
        DockPresenterControl presenterControl = panel.DefaultPresenter as DockPresenterControl;
        RadTabStripElement tabStripElement = (presenterControl.DockPresenterElement.Children[2].Children[2] as RadTabStripElement);
        foreach (DockableTab tab in tabStripElement.Items)
        {
            if (tab.Element == panel)
            {
                tab.Image = img;
                return;
            }
        }
    }


    where Bitmap img is the image you would like to set and DockPanel panel is a reference to the docked IDockable instance.

    Kind regards,
    Dimitar Kapitanov
    the telerik team
Back to Top