List<Image> lstImage = new List<Image>(); for (int i = 0; (i < recLeft) ; i++) { Image img = Image.FromFile( <complete path="">"tmp.jpg"); Image newImg = img.GetThumbnailImage(_imageSize, _imageSize, null, IntPtr.Zero); lstImage.Add(newImg); } for (int row = 0; row < numRows; row++) { DataGridViewRow dRow = new DataGridViewRow(); recLeft = numRec - (numColumnsForWidth * row); for (int col = 0; (col < recLeft) && (col < numColumnsForWidth); col++) { this.dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect; dataGridView1.Rows[row].Cells[col].Value= lstImage[0]; } dataGridView1.Rows.Add(); }
dataGridView1.Rows[row].Cells[col].Value= lstImage[0];
"index out of range" even if i substitute row and col in above line with 0, which means trying to add atleast one image in 1st col and 1st ro then again error is same.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)