ThreadStart ths = delegate { DownloadImages(ds.Tables[0].Rows.Count,ds); }; Thread download = new Thread(ths); download.Priority = ThreadPriority.Highest; download.IsBackground = true; download.Start()
DataGridViewImageColumn images = new DataGridViewImageColumn(); images.Name = "Images"; if(dataGridView1.Columns.Contains("Images")) dataGridView1.Columns.Remove("Images"); wbC[0] = new WebClient(); wbC[0].Proxy = null; dataGridView1.Columns.Add(images); dataGridView1.Columns["Images"].DisplayIndex = 2; for (int i = 0; i < Rowcount; i++) { try { byte[] img = wbC[0].DownloadData((ds.Tables[0].Rows[i]["ImageLink"].ToString())); MemoryStream ms = new MemoryStream(img); ((DataGridViewImageCell)dataGridView1.Rows[i].Cells["Images"]).Value=Image.FromStream(ms); } catch { } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)