RadListBoxes inside a RadPanelbar

4 posts, 0 answers
  1. Renato Lopes
    Renato Lopes avatar
    13 posts
    Member since:
    Sep 2007

    Posted 22 Sep 2008 Link to this post

    How can I put RadListBoxes inside a RadPanelbar?
  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 24 Sep 2008 Link to this post

    Hello Renato Lopes,

    Thank you for the question.

    I suppose that you want to add a label to some of the PanelBarGroups. In this case you could use the PanelBarGroupElement Items collection. Please, review the code-block below:
     
    RadLabelElement labelElement = new RadLabelElement(); 
    labelElement.Text = "label element"
     
    this.radPanelBarGroupElement1.Items.Add(labelElement); 

    The other way is to use the RadPanelBarGroupElement's property EnableHostControlMode. When you set this property to true then we add a ContentPanel as a child of the group element When the groups have EnableHostControlMode = true then you simply have to drag and drop RadLabel control into the content panel.

    Please, let me know if this does not suite to your scenario.

    Greetings,
    Martin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Renato Lopes
    Renato Lopes avatar
    13 posts
    Member since:
    Sep 2007

    Posted 25 Sep 2008 Link to this post

    label??

    I wan't to add a radListBox inside each group of the RadPanelBar.
  5. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 25 Sep 2008 Link to this post

    Hi Renato Lopes,

    Please excuse me for the misunderstanding.

    Adding a RadListBox is almost the same as RadLabel. Please take a look at the slightly changed code below:
     
    RadListBoxElement listBoxElement = new RadListBoxElement(); 
    listBoxElement.MinSize = new Size(0,50); 
    listBoxElement.Items.AddRange(new RadListBoxItem[]  
        {new RadListBoxItem("item1"), new RadListBoxItem("item2")});  
     
    this.radPanelBarGroupElement1.Items.Add(listBoxElement); 

    Note that is important to set a min height size of RadListBoxElement, otherwise it will not be visible.

    If you have other questions, do not hesitate to contact me again.
     

    Greetings,
    Martin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top