is it possible to insert Treeview in radPanelBarGroupElement??

4 posts, 0 answers
  1. lee doo
    lee doo avatar
    4 posts
    Member since:
    Nov 2009

    Posted 05 Oct 2010 Link to this post

    I want to insert Treeview in radPanelBarGroupElement.

    but I dont know what I have to do!!
  2. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 05 Oct 2010 Link to this post

    Hello lee,

    Before providing a solution, i wanted to ask you if there isn't any way of switching to the new RadPageView control, because as you might now, the RadTabBar is obsolete and will be removed soon...

    Now, if you want to do this, there are a few things you have to know about the RadTabBar, first, by default it just accepts RadItems, not controls, but if you want the TabBar to accept controls, you have to create a group, and set it's  EnableHostedControlMode to true, after this you can add the controls you want using the groups ContentPanel.Controls property. If you want to read some more about the RadTabBar control you should take a look at the available documentation (PanelBar Documentation).

    I have created a full working example as follows:
    using System.Windows.Forms;
     
     using Telerik.WinControls.UI;
     
     public partial class Form1 : Form
     {
         private RadPanelBar radPanelBar1 = new RadPanelBar();
     
         public Form1()
         {
             InitializeComponent();
             this.Load += new System.EventHandler(Form1_Load);
         }
     
         void Form1_Load(object sender, System.EventArgs e)
         {
             radPanelBar1.Dock = DockStyle.Fill;
             this.Controls.Add(radPanelBar1);
     
             var radGroupContacts =
    new RadPanelBarGroupElement();
             radGroupContacts.Caption = "Contacts";
             var radGroupCalendar =
                new RadPanelBarGroupElement();
             radGroupCalendar.Caption = "Calendar";
     
             radPanelBar1.GroupStyle = Telerik.WinControls.PanelBarStyles.ListBar;
             var radGroupTree =
    new RadPanelBarGroupElement();
             radGroupTree.EnableHostControlMode = true;
     
             var radTreeView1 = new RadTreeView();
             var node1 = new RadTreeNode("Node1");
             var node2 = new RadTreeNode("Node2");
             var node3 = new RadTreeNode("Node3");
             var node4 = new RadTreeNode("Node4");
             radTreeView1.Nodes.Add(node1);
             radTreeView1.Nodes.Add(node2);
             node1.Nodes.Add(node3);
             node2.Nodes.Add(node4);
             radTreeView1.Dock = DockStyle.Fill;
             radGroupTree.ContentPanel.Controls.Add(radTreeView1);
             radGroupTree.Caption = "TreeView Example";
     
             radPanelBar1.Items.AddRange(new Telerik.WinControls.RadItem[] { radGroupTree, radGroupCalendar, radGroupContacts });
         }
     }

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
  3. UI for WinForms is Visual Studio 2017 Ready
  4. lee doo
    lee doo avatar
    4 posts
    Member since:
    Nov 2009

    Posted 06 Oct 2010 Link to this post

    Thanks very much!!

    I dont know RadPageVIew is in Component.

    simply I use it!!! :)


     
  5. Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 07 Oct 2010 Link to this post

    Hello again Lee,

    The PageViewControl is a relatively new control, so it depends on the version of telerik controls you are using, I would recommend updating to the latest version, Q2 2010 SP 2 to take advantage of the new controls and also benefit from the performance increase in the controls provided by the new virtualization mechanism To see more release and other information about this release click here.

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga
Back to Top