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

Using multipage with the panelbar to load custom controls in pageview

1 Answer 67 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 17 Nov 2008, 02:45 AM

Is there a way to use multipage with the panelbar control. I want to utilize similar functionality as in the "Defining the RadMultiPage structure in the code-behind" example in the online help for the tabstrip control. The panelbar doesn't have integration with multipage as does the tabstrip so I am not sure the same functionality can be accomplished. I would like to load a custom user control in the page view upon clicking a particular item or subitem on the panelbar. This is the code I am using for the tabstrip. I would like to have the same functionality using the panelbar.

 

Imports

Telerik.Web.UI

 

 

 

Partial

Class inventory_4

 

 

Inherits System.Web.UI.Page

 

 

Private Function ReplaceSpaces(ByVal RepString As String)

 

ReplaceSpaces = RepString.Replace(

" ", "_")

 

ReplaceSpaces = ReplaceSpaces.ToString

 

End Function

 

 

 

 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

 

 

If Not Page.IsPostBack Then

 

 

 

AddTab(

"Store")

 

AddTab(

"Marketplaces")

 

AddTab(

"Shopping Feeds")

 

 

 

 

End If

 

 

 

 

End Sub

 

 

 

 

Private Sub AddTab(ByVal tabName As String)

 

 

Dim tab As New RadTab()

 

tab.Text = (tabName)

RadTabStrip1.Tabs.Add(tab)

 

Dim pageView As New RadPageView()

 

pageView.ID = tabName

RadMultiPage1.PageViews.Add(pageView)

 

End Sub

 

 

 

 

Protected Sub RadMultiPage1_PageViewCreated(ByVal sender As Object, ByVal e As RadMultiPageEventArgs) Handles RadMultiPage1.PageViewCreated

 

 

Dim FunctionPage As String

 

 

 

FunctionPage =

"inventory_"

 

 

 

 

Dim userControlName As String = FunctionPage & ReplaceSpaces(e.PageView.ID) & ".ascx"

 

 

 

 

Dim userControl As Control = Page.LoadControl(userControlName)

 

userControl.ID = ReplaceSpaces(e.PageView.ID) &

"_userControl"

 

 

 

e.PageView.Controls.Add(userControl)

 

End Sub

 

 


Thank you in advance.

DMY



1 Answer, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 17 Nov 2008, 08:36 AM
Hi Dan,

Please refer to our Outlook Navigation example for details on the matter.

Sincerely yours,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
PanelBar
Asked by
Dan
Top achievements
Rank 1
Answers by
Paul
Telerik team
Share this question
or