📄 defaultvb.aspx.vb
字号:
Imports System
Imports Telerik.WebControls
Imports Telerik.QuickStart
Imports Telerik.QuickStart.Grid
Namespace Telerik.GridExamplesVBNET.Hierarchy.ThreeLevel
Public MustInherit Class DefaultVB
Inherits XhtmlPage
Protected WithEvents Button1 As Button
Protected WithEvents RadGrid1 As RadGrid
Private Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
If Not e.IsFromDetailTable Then
RadGrid1.DataSource = DataSourceHelperVB.GetDataTable("SELECT * FROM Customers")
End If
RadGrid1.MasterTableView.DetailTables(0).DataSource = DataSourceHelperVB.GetDataTable("SELECT * FROM Orders")
RadGrid1.MasterTableView.DetailTables(0).DetailTables(0).DataSource = DataSourceHelperVB.GetDataTable("SELECT * FROM [Order Details]")
End Sub
Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
'Setting Selected index prior to binding RadGrid:
'If the index is in detail table, parent items will be expanded
'automatically
RadGrid1.SelectedIndexes.Add(1, 0, 1, 0, 1)
'Index of 1, 0, 2, 0, 0 means:
'1 - item with index 1 in MasterTabelView
'0 - detail table with index 0
'1 - second (index 1) item in the detail table
'0 - 0 sub-detail
'1 - sub detail item with index 1
End If
End Sub
End Class
End Namespace
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -