vb.netdata-structuresdatagridtimeslots

A Data Structure to represent bookable timeslots


What suggestions do people have for a timeslot data structure?

I have a number of activities and I'm planning to display them in a datagrid with days as columns and timeslots as rows. This suggests to me a timeslot data structure with 5 properties for the five days (the columns) for every value I want to use e.g. a timeslot ID and the number of slots left.

So...

Then each TimeSlot structure would be for a specific time... say 9:00 and another for each hour after that. Then I'd have a list of timeslot structures that will auto bind against the datagrid.

I'm exporing new ground here and as you can see I'm not very clear on what/how to do it?

All suggestions welcome,

Thanks


Solution

  • Create a structure like this:

    struct DayInfo
    {
        int ID;
        int[] Slots;
    }
    

    and then have a List to store all your data, which can be easy binded to 2 nested repeaters.