PDA

View Full Version : سوال: نحوه نمایش عکس در GridView



saman7198
شنبه 06 تیر 1388, 11:14 صبح
با سلام
چگونه می تان یک عکی را در GridView نشان داد

daneshjoo2
شنبه 06 تیر 1388, 12:18 عصر
سلام

System.Windows.Forms.DataGridViewImageCell cell = new DataGridViewImageCell();
cell.Value = Image.FromFile(@"[FileName]");
dataGridView1.Columns.Add("1", "Image");
dataGridView1.Rows.Add();
dataGridView1.Rows[0].Cells[0] = cell;

alireza_tavakol
شنبه 06 تیر 1388, 15:00 عصر
میشه یکی توضیح بده این عکسی که قرار داریم توی یک سلول رو چطوری Strech کنیم که وقتی کاربر ابعاد سلول جدول رو تغییر داد عکس هم همزمان بزرگ یا کوچیک بشه ؟:چشمک:

daneshjoo2
شنبه 06 تیر 1388, 15:27 عصر
سلام
کد:
System.Windows.Forms.DataGridViewImageCell cell = new DataGridViewImageCell();
cell.Value = Image.FromFile(@"[FileName]");
dataGridView1.Columns.Add("1", "Image");
dataGridView1.Rows.Add();
dataGridView1.Rows[0].Cells[0] = cell;


cell.ImageLayout = DataGridViewImageCellLayout.Stretch;