defaultvb.aspx.vb

来自「Telerik是很大的第三方软件制造商」· VB 代码 · 共 40 行

VB
40
字号
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 + =
减小字号Ctrl + -
显示快捷键?