Click here to Skip to main content
15,868,056 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am starting the a DownloadImages like this.
C#
ThreadStart ths = delegate { DownloadImages(ds.Tables[0].Rows.Count,ds); };
 Thread download = new Thread(ths);
 download.Priority = ThreadPriority.Highest;
 download.IsBackground = true;
 download.Start()

a part of my function.
C#
 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
                {

                }
            }


but when I want to sort the others columns like 'prices' images are dissappear.
any ideas?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900