Next it’s time to bring in our reservations. We’ll still be using nested galleries for this solution, where the outer gallery holds the room name and the inner gallery holds the dates in the month. We’ll indicate reservation using styling on labels within the inner gallery.
First add a blank vertical gallery to the screen. It should be wider than the first MonthDays gallery as we need space for the room. I set the Items property to Distinct(colReservations, Room) and set TemplatePadding to 0, and then added a blank horizontal gallery. I was able to use the Distinct function to show the room names because of the size of my data set, but please remember this is not delegable so you may need to modify your approach here.
Within the inner gallery, a similar approach to the first days gallery can be followed for styling purposes. A label can be added to the inner gallery with a Text property of ThisItem.Value and a width of Parent.TemplateWidth. Additionally, I renamed the gallery to galReservations, set TemplateSize to Self.Width / CountRows(Self.AllItems), and set TemplatePadding to 0. The major difference will be the Items property; we need to connect this gallery to actual dates and not just a day representation. We can still use the number of days in the month to get the number of items in the gallery, and then starting with the first day of the month, each iteration should be incremented by one day.
0 Comments