This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
/
Form1.vb
38 lines (34 loc) · 1.71 KB
/
Form1.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Imports DevExpress.XtraLayout
Imports System
Imports System.Data
Imports System.Windows.Forms
Namespace S131978
Partial Public Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
productsBindingSource.DataSource = GetProductsDataTable()
CType(layoutView1, ILayoutControl).OptionsFocus.MoveFocusDirection = MoveFocusDirection.DownThenAcross
End Sub
Private Function GetProductsDataTable() As DataTable
Dim table As DataTable = New DataTable()
table.TableName = "Products"
table.Columns.Add(New DataColumn("ProductID", GetType(Integer)))
table.Columns.Add(New DataColumn("ProductName", GetType(String)))
table.Columns.Add(New DataColumn("SupplierID", GetType(Integer)))
table.Columns.Add(New DataColumn("CategoryID", GetType(String)))
table.Columns.Add(New DataColumn("QuantityPerUnit", GetType(Integer)))
table.Columns.Add(New DataColumn("UnitPrice", GetType(Double)))
table.Columns.Add(New DataColumn("UnitsInStock", GetType(Integer)))
table.Columns.Add(New DataColumn("UnitsOnOrder", GetType(Integer)))
table.Columns.Add(New DataColumn("ReorderLevel", GetType(Integer)))
For i As Integer = 0 To 20 - 1
Dim index As Integer = i + 1
table.Rows.Add(index, "Product " & index, index * 2, index * 3, index Mod 7, index * 1000.0R + index * 100.0R, index Mod 5, index Mod 9, index Mod 3)
Next
Return table
End Function
End Class
End Namespace