📄 defaultvb.aspx.vb
字号:
Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports Telerik.QuickStart
Imports Telerik.WebControls
Namespace Telerik.TabStripExamplesVB.Application.DynamicControls
'/ <summary>
'/ Summary description for DefaultCS.
'/ </summary>
Public Class DefaultVB
Inherits XhtmlPage
Protected PageContent As System.Web.UI.WebControls.Label
Protected RadTabStrip1 As RadTabStrip
Protected BuildingSummary As System.Web.UI.WebControls.Repeater
Protected PageView1 As Telerik.WebControls.PageView
Protected WithEvents RadMultiPage1 As Telerik.WebControls.RadMultiPage
Public ReadOnly Property SampleData() As DataTable
Get
Dim table As DataTable = CType(Cache("CachedSampleData"), DataTable)
If table Is Nothing Then
Dim adapter As New OleDbDataAdapter("SELECT * FROM Buildings", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/TabStrip/Data/data.mdb"))
table = New DataTable()
adapter.Fill(table)
Cache("CachedSampleData") = table
End If
Return table
End Get
End Property
Private Sub Page_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If Not IsPostBack Then
BindTabStrip()
BindMultiPage()
End If
End Sub 'Page_Load
Private Sub BindMultiPage()
Dim i As Integer
For i = 0 To SampleData.Rows.Count - 1
Dim pv As New PageView()
BuildPageViewContents(pv, i)
RadMultiPage1.PageViews.Add(pv)
Next i
End Sub 'BindMultiPage
Private Sub BuildPageViewContents(pageView As PageView, index As Integer)
Dim [source] As DataRow = SampleData.Rows(index)
Dim description As New LiteralControl(CStr([source]("Description")))
pageView.Controls.Add(description)
End Sub 'BuildPageViewContents
Private Sub BindTabStrip()
RadTabStrip1.AppendDataBoundItems = True
RadTabStrip1.DataSource = SampleData
RadTabStrip1.DataTextField = "Name"
RadTabStrip1.DataBind()
End Sub 'BindTabStrip
Protected Overrides Sub OnInit(e As EventArgs)
'
' CODEGEN: This call is required by the ASP.NET Web Form Designer.
'
InitializeComponent()
MyBase.OnInit(e)
End Sub 'OnInit
'/ <summary>
'/ Required method for Designer support - do not modify
'/ the contents of this method with the code editor.
'/ </summary>
Private Sub InitializeComponent()
End Sub 'InitializeComponent
Private Sub RadMultiPage1_PageViewItemCreated(view As PageView, viewIndex As Integer) Handles RadMultiPage1.PageViewItemCreated
BuildPageViewContents(view, viewIndex)
End Sub 'RadMultiPage1_PageViewItemCreated
End Class 'DefaultVB
End Namespace 'Telerik.TabStripExamplesVB.Application.DynamicControls
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -