Fully Dynamic Load

4 posts, 1 answers
  1. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 08 Sep 2010 Link to this post

    Hello,

    Searched the forums for a while, but not really what i'm looking for... I want full dynamic load of tab, pages and controls on the page. I also tried it with an event (PageViewCreated) using AddHandler, as in an example, but no luck...

    I was wondering why this wont work:

    Private Sub _Default_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        Dim PH As PlaceHolder = PlaceHolder1
     
        Dim RTS As New RadTabStrip
        Dim RMP As New RadMultiPage
     
        For i As Integer = 1 To 4
            Dim RT As RadTab = New RadTab
            RT.Text = "Tab " & i
            RT.PageViewID = "Tab_" & i
            RTS.Tabs.Add(RT)
     
            Dim RPV As New RadPageView
            RPV.ID = "Tab " & i
            RMP.PageViews.Add(RPV)
     
            Dim Pnl As Panel = New Panel
            Pnl.Controls.Add(New LiteralControl("tabbie " & i))
            RPV.Controls.Add(Pnl)
     
        Next i
        RTS.SelectedIndex = 0
        PH.Controls.Add(RMP)
        PH.Controls.Add(RTS)
     
    End Sub

    Thanks,

    Erik
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 09 Sep 2010 Link to this post

    Hello,


    I hope the following demo will shed some light in implementing the scenario.
    Load on Demand RadPageView


    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 09 Sep 2010 Link to this post

    Hi Proovit,

    The code seems correct, you just need to set MultiPageID property of the tabstrip to integrate it with the multipage:

    Private Sub _Default_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
            Dim PH As PlaceHolder = PlaceHolder1
      
            Dim RTS As New RadTabStrip
            Dim RMP As New RadMultiPage
            RMP.ID = "RadMultiPage1"
      
            For i As Integer = 1 To 4
                Dim RT As RadTab = New RadTab
                RT.Text = "Tab " & i
                RT.PageViewID = "Tab_" & i
                RTS.Tabs.Add(RT)
                RTS.MultiPageID = RMP.ID
      
                Dim RPV As New RadPageView
                RPV.ID = "Tab " & i
                RMP.PageViews.Add(RPV)
      
                Dim Pnl As Panel = New Panel
                Pnl.Controls.Add(New LiteralControl("tabbie " & i))
                RPV.Controls.Add(Pnl)
      
            Next i
            RTS.SelectedIndex = 0
            RMP.SelectedIndex = 0
            PH.Controls.Add(RMP)
            PH.Controls.Add(RTS)
      
        End Sub


    Kind regards,
    Yana
    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
  5. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 03 Apr 2011 Link to this post

    Was struggling with the code again:

    you should first add the tab and then the pageview:

    PH.Controls.Add(RTS)
      PH.Controls.Add(RMP)

    Otherwise the controls on the tab appear above the tab...
Back to Top