private void Form1_Load(object sender, EventArgs e)
{
//直接赋值
//dataGridView1[0, 0].Value = Image.FromFile("E:\\文件\\最美的地方\\1.jpg/");
//dataGridView1[0, 0].Value = this.imageList1.Images[2];
//通过imagelist作为中介然后赋值
for (int i = 0; i < imageList1.Images.Count; i++)
{
dataGridView1.Rows.Add();
dataGridView1[i, 0].Value = this.imageList1.Images[i];
}
}
//通过事件绘制
//private void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
//{
// e.Value = imageList1.Images[0];
//}
}