This is a migrated thread and some comments may be shown as answers.

Fully Dynamic Load

3 Answers 85 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 2
Erik asked on 08 Sep 2010, 09:35 PM
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

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 09 Sep 2010, 11:01 AM
Hello,


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


-Shinu.
0
Accepted
Yana
Telerik team
answered on 09 Sep 2010, 11:16 AM
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
0
Erik
Top achievements
Rank 2
answered on 03 Apr 2011, 05:28 PM
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...
Tags
TabStrip
Asked by
Erik
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Yana
Telerik team
Erik
Top achievements
Rank 2
Share this question
or