I have created an array of lists. The array has seven rows who represents the days of week and the lists contain the available slots for doctor appointments. I am trying to bind it with a GridView or a DataList (whatever is more appropriate) without success.
I have declared the list:
List<string>[] list=new List<string>[7]; //An array of 7 lists
for (int i = 0; i < 7; i++)
{
list[i]=new List<string>();
}
I have filled in the lists with strings that represent the available slots for appointments with a doctor.
The result that I want to achieve is the availability for one of the doctors as it is depicted at this site: link
You could change the array to a
List<List<string>>like this:Then you can bind it to a
GridViewin the following way (just adapt to your case):Source: Use
List<List<string>>as GridView – DataSource