This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.cs
42 lines (39 loc) · 1.58 KB
/
Form1.cs
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
39
40
41
42
using DevExpress.XtraLayout;
using System;
using System.Data;
using System.Windows.Forms;
namespace S131978
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
productsBindingSource.DataSource = GetProductsDataTable();
((ILayoutControl)layoutView1).OptionsFocus.MoveFocusDirection = MoveFocusDirection.DownThenAcross;
}
DataTable GetProductsDataTable()
{
DataTable table = new DataTable();
table.TableName = "Products";
table.Columns.Add(new DataColumn("ProductID", typeof(int)));
table.Columns.Add(new DataColumn("ProductName", typeof(string)));
table.Columns.Add(new DataColumn("SupplierID", typeof(int)));
table.Columns.Add(new DataColumn("CategoryID", typeof(string)));
table.Columns.Add(new DataColumn("QuantityPerUnit", typeof(int)));
table.Columns.Add(new DataColumn("UnitPrice", typeof(double)));
table.Columns.Add(new DataColumn("UnitsInStock", typeof(int)));
table.Columns.Add(new DataColumn("UnitsOnOrder", typeof(int)));
table.Columns.Add(new DataColumn("ReorderLevel", typeof(int)));
for(int i = 0; i < 20; i++)
{
int index = i + 1;
table.Rows.Add(index, "Product " + index, index * 2, index * 3, index % 7, index * 1000d + index * 100d, index % 5, index % 9, index % 3);
}
return table;
}
}
}