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

How can I write my own tab name in this example?

0 Answers 25 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Aamir
Top achievements
Rank 1
Aamir asked on 22 Oct 2012, 08:29 PM
This examples takes the name of the tab from the name of the .ascx file. I want to have my own tab name,which may include spaces as well.
Imports System
Imports Telerik.Web.UI
 
 
Namespace Telerik.Web.Examples.TabStrip.ApplicationScenarios.LoadOnDemand
 
    Partial Public Class DefaultVB
        Inherits System.Web.UI.Page
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            If Not Page.IsPostBack Then
                AddTab("Customers")
                AddPageView(RadTabStrip1.FindTabByText("Customers"))
                AddTab("Products")
                AddTab("Orders")
            End If
        End Sub
 
        Private Sub AddTab(ByVal tabName As String)
            Dim tab As RadTab = New RadTab
            tab.Text = tabName
            RadTabStrip1.Tabs.Add(tab)
        End Sub
 
        Protected Sub RadMultiPage1_PageViewCreated(ByVal sender As Object, ByVal e As RadMultiPageEventArgs) Handles RadMultiPage1.PageViewCreated
            Dim userControlName As String = e.PageView.ID & "VB.ascx"
            Dim userControl As Control = Page.LoadControl(userControlName)
            userControl.ID = e.PageView.ID & "_userControl"
            e.PageView.Controls.Add(userControl)
        End Sub
 
        Private Sub AddPageView(ByVal tab As RadTab)
            Dim pageView As RadPageView = New RadPageView
            pageView.ID = tab.Text
            RadMultiPage1.PageViews.Add(pageView)
            pageView.CssClass = "pageView"
            tab.PageViewID = pageView.ID
        End Sub
 
        Protected Sub RadTabStrip1_TabClick(ByVal sender As Object, ByVal e As RadTabStripEventArgs) Handles RadTabStrip1.TabClick
            AddPageView(e.Tab)
            e.Tab.PageView.Selected = True
        End Sub
 
    End Class
 
End Namespace

No answers yet. Maybe you can help?

Tags
TabStrip
Asked by
Aamir
Top achievements
Rank 1
Share this question
or