<MudTimeline TimelineOrientation="TimelineOrientation.Horizontal" TimelinePosition="TimelinePosition.Alternate" >
@for (int i = 0; i < allBookings.Count - 3; i += 3)
{
//bookString.Add(allBookings[i + 1]);
<MudTimelineItem Color="Color.Error" Variant="Variant.Filled">
<ItemContent>
<MudAlert Severity="Severity.Error">@allBookings[i+1]</MudAlert>
</ItemContent>
<ItemOpposite>
<MudText Color="Color.Error">@allBookings[i]</MudText>
</ItemOpposite>
</MudTimelineItem>
}
</MudTimeline>
I want to add a new timeline item when a new booking is added. But the loop will always make all the previous bookings to the same value as the last one. I tried to move the loop functions around, but either it doesn't work the way I wanted or it simply doesn't allow it. I also tried to make a new list to store all the existing customers and compare it, but that didn't work out either. I know this is more of a logic problem than a programmatic one, but please send help.