Riddhish Rajani

Riddhish Rajani

  • NA
  • 93
  • 9.3k

Window Form Application

Apr 8 2017 9:20 AM
Hello 
I am working on Window Form Application using C#.
I bind list of data in Data Grid View & there is one image column & image have to download first from Server URL.
 
Faccing issue is  that , i download image into Data Grid View Cell Formatting event  & grid take time to load, when first row image download then after bind second row of grid.
 
I want to bind Grid using Async Call.
My code is :
 
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(this.dgv.Rows[e.RowIndex].Cells[7].Value.ToString());
myRequest.Method = "GET";
HttpWebResponse myResponse = (HttpWebResponse)(myRequest.GetResponse());
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(myResponse.GetResponseStream());
myResponse.Close();
e.Value = new Bitmap(bmp, 90, 90);
 
Thanks & Regards
Riddhish Rajani