So I have a table which looks as below. The data is populating correctly for one class object.
What I am trying to do is create 5 lots of this table, and apart from the table name, have everything else the same. So I somehow need have the label names in a loop so that multiple objects can populate
lblDescription[0]
lblDescription1
And same with the other labels.
Here is my C# code which is populating the single table currently.
JavaScriptSerializer serializer = new JavaScriptSerializer();
WeatherInfo weatherinfo = serializer.Deserialize<WeatherInfo>(json);
int i = 0;
foreach (List list in weatherinfo.list)
{
lblCity_Country.Text = weatherinfo.city.name;
//lblDescription.Text = weatherinfo.list[0].weather[0].description;
lblTempMin.Text = string.Format("{0}", Math.Round(weatherinfo.list[i].main.temp_min, 1));
lblTempMax.Text = string.Format("{0}", Math.Round(weatherinfo.list[i].main.temp_max, 1));
lblHumidity.Text = weatherinfo.list[i].main.humidity.ToString();
tblWeather.Visible = true;
i++;
}
So each list object is populating one table. But I need to have my table configuration set up dynamically, that that it can work for any number of 'list' objects.
I hope I have explained this well,
Any help would be appreciated,
Thanks
