this the xml code this the image i have to display datagridview colums //cdn.apixu.com/weather/64x64/day/113.png
1000this is the code I have tried in c#.net. all data will display correctly but image is not displaying the only path is displaying at the datagridview.how to display the image at datgridview
DataTable dt = new DataTable();
dt.Columns.Add("country", typeof(string));
dt.Columns.Add("Date", typeof(string));
dt.Columns.Add("Max Temp", typeof(string));
dt.Columns.Add("Min Temp", typeof(string));
dt.Columns.Add("Text", typeof(string));
dt.Columns.Add("Icon", typeof(string));
city = txttext.Text;
string uri = string.Format("http://api.apixu.com/v1/forecast.xml?={0}&days=7", city);
XDocument doc = XDocument.Load(uri);
foreach (var npc in doc.Descendants("forecastday"))
{
dt.Rows.Add(new object[] {
(string)doc.Descendants("country").FirstOrDefault(),
(string)npc.Descendants("date").FirstOrDefault(),
(string)npc.Descendants("maxtemp_c").FirstOrDefault(),
(string)npc.Descendants("mintemp_c").FirstOrDefault(),
(string)npc.Descendants("text").FirstOrDefault(),
"http:" +(string)npc.Descendants( "icon").FirstOrDefault()
});
}
dataGridView1.DataSource = dt;
ali tuncerPosted Oct 20, 2017, 5:14 AM
Try something like this :