System.Windows.Forms.DataGridView dgv1 = new System.Windows.Forms.DataGridView();
dgv1.ColumnCount = data[0].Length;
for (int i = 0; i < dgv1.ColumnCount; i++)
{
dgv1.Columns[i].HeaderText = "ColumnName" + i.ToString();
}
dgv1.Rows.Clear();
List<object> subdata = new List<object>();
for (int i = 0; i < data.Length; i++)
{
subdata.Clear();
for (int j = 0; j < data[0].Length; j++)
{
subdata.Add(data[i][j]);
}
dgv1.Rows.Add(subdata.ToArray());
}
全站熱搜
留言列表