Add LayoutControlGroupItem by Code

2 posts, 0 answers
  1. Dario Concilio
    Dario Concilio avatar
    115 posts
    Member since:
    Apr 2016

    Posted 05 May Link to this post

    Hi to all,

    I would create a structure like this:

    • MainForm (mdi)
    • PageView (outlook) dock.left
    • LayoutControlTabbedGroup
    • Every PageView contains a treeview (classic outlook approach)
    • When click a node of current pageview-treeview, it has to:
      • Create a LayoutControlGroupItem
      • Create a MyUserControl (relative to type of node)
      • Add MyUserControl to LayoutControlGroupItem
      • Add LayoutControlGroupItem to LayoutControlTabbedGroup

      Can I do this?

      Actually Imet this problem, when I try to add valuteUC to valuteLG it says me thatvaluteLG.Container = Nothing

      What I have to do?

      Dim valuteUC = New ValuteUserControl()
      Dim valuteLG = New LayoutControlGroupItem()

  2. Dimitar
    Dimitar avatar
    1326 posts

    Posted 06 May Link to this post

    Hi Potito,

    Thank you for writing.

    The following snippet shows how you can add items to RadLayoutControl:
    Dim tabbedgroup As New LayoutControlTabbedGroup()
    Dim groupItem As New LayoutControlGroupItem()
    groupItem.Text = "group 1"
    Dim button As New RadButton() With {.Text = "Button"}
    button.Click += Button_Click
    Dim item As New LayoutControlItem()
    item.AssociatedControl = button
    radLayoutControl1.AddItem(item, groupItem.ContainerElement)

    The above code uses the AddItem method which provides several overrides and it is recommended for the items adding.

    Please let me know if there is something else I can help you with. 
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft banner
Back to Top