Imports GrapeCity.Win.MultiRow
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' データを作成する
Dim dt As New DataTable("TEST")
dt.Columns.Add("Emplyee", GetType(String))
dt.Columns.Add("Age", GetType(Integer))
dt.Columns.Add("Gender", GetType(String))
dt.Columns.Add("Division", GetType(String))
dt.Columns.Add("Sales", GetType(Integer))
dt.Rows.Add("渡部 博久", 28, "M", "東京本社", 150000)
dt.Rows.Add("中島 雄太", 47, "M", "東京本社", 240000)
dt.Rows.Add("秋山 佳美", 34, "F", "大阪支社", 180000)
dt.Rows.Add("佐藤 政義", 41, "M", "大阪支社", 350000)
dt.Rows.Add("坂本 則夫", 26, "M", "大阪支社", 120000)
dt.Rows.Add("黒田 宏則", 51, "M", "仙台支社", 100000)
dt.Rows.Add("木村 栄一", 44, "M", "仙台支社", 200000)
dt.Rows.Add("赤坂 美和", 35, "F", "京都支社", 160000)
dt.Rows.Add("遠藤 保孝", 56, "M", "京都支社", 380000)
dt.Rows.Add("小川 和義", 27, "M", "京都支社", 230000)
dt.AcceptChanges()
' テンプレートを作成する
Dim Template1 As New Template1()
Template1.Row.Cells(0).DataField = "Emplyee"
Template1.Row.Cells(1).DataField = "Age"
Template1.Row.Cells(2).DataField = "Gender"
Template1.Row.Cells(3).DataField = "Division"
Template1.Row.Cells(4).DataField = "Sales"
' MultiRowを設定する
GcMultiRow1.Template = Template1
GcMultiRow1.AllowUserToAddRows = False
GcMultiRow1.DataSource = dt
End Sub
using GrapeCity.Win.MultiRow;
private void Form1_Load(object sender, EventArgs e)
{
// データを作成する
DataTable dt = new DataTable("TEST");
dt.Columns.Add("Emplyee", typeof(String));
dt.Columns.Add("Age", typeof(int));
dt.Columns.Add("Gender", typeof(String));
dt.Columns.Add("Division", typeof(String));
dt.Columns.Add("Sales", typeof(int));
dt.Rows.Add("渡部 博久", 28, "M", "東京本社", 150000);
dt.Rows.Add("中島 雄太", 47, "M", "東京本社", 240000);
dt.Rows.Add("秋山 佳美", 34, "F", "大阪支社", 180000);
dt.Rows.Add("佐藤 政義", 41, "M", "大阪支社", 350000);
dt.Rows.Add("坂本 則夫", 26, "M", "大阪支社", 120000);
dt.Rows.Add("黒田 宏則", 51, "M", "仙台支社", 100000);
dt.Rows.Add("木村 栄一", 44, "M", "仙台支社", 200000);
dt.Rows.Add("赤坂 美和", 35, "F", "京都支社", 160000);
dt.Rows.Add("遠藤 保孝", 56, "M", "京都支社", 380000);
dt.Rows.Add("小川 和義", 27, "M", "京都支社", 230000);
dt.AcceptChanges();
// テンプレートを作成する
Template template1 = new Template1();
template1.Row.Cells[0].DataField = "Emplyee";
template1.Row.Cells[1].DataField = "Age";
template1.Row.Cells[2].DataField = "Gender";
template1.Row.Cells[3].DataField = "Division";
template1.Row.Cells[4].DataField = "Sales";
// MultiRowを設定する
gcMultiRow1.Template = template1;
gcMultiRow1.AllowUserToAddRows = false;
gcMultiRow1.DataSource = dt;
}