Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote

I'm using SfSchedule to display a List of ScheduleForm data, which is generated in OnInitialized method using previously loaded data from ScheduleService​. However, when the application is opened, the SfSchedule is loaded as empty. Even after the data is loaded, the SfSchedule doesn't display the data, even though the List<ScheduleForm> is correctly filled. 

SfSchedule code:

@page "/schedule"

@using MyProject.Shared.Models

@inject IScheduleService ScheduleService

<SfSchedule TValue="ScheduleForm" SelectedDate="@(new DateTime(2021, 4, 12))" CurrentView="View.Week" FirstDayOfWeek="1">    

<ScheduleViews>       

<ScheduleView Option="View.Day" StartHour="07:00" EndHour="22:00"></ScheduleView>        

<ScheduleView Option="View.Week" StartHour="07:00" EndHour="22:00"></ScheduleView>   

</ScheduleViews>    

<ScheduleEventSettings DataSource="@schedules"></ScheduleEventSettings>

</SfSchedule>

@code:

@code {    

int number = 1;    
string course = "A";    
List<MyProject.Shared.Models.Schedule> schedulesData = new List<MyProject.Shared.Models.Schedule>();    
List<ScheduleForm> schedules = new List<ScheduleForm>();    

protected override async Task OnInitializedAsync()    
{        
await ScheduleService.LoadSchedules();        
schedulesData = ScheduleService.Schedules;        
int i = 0;        
foreach (var schedule in schedulesData)        
{            
foreach (var entry in schedule.Entries)            
{                
if (entry.Course == course && entry.Subject.Number == number)                
{                    
DateTime StartDate = new DateTime(schedule.Date.Year, schedule.Date.Month,                    schedule.Date.Day, entry.Start.Hour, entry.Start.Minute, 0);     
DateTime EndDate = new DateTime(schedule.Date.Year, schedule.Date.Month,                  schedule.Date.Day, entry.End.Hour, entry.End.Minute, 0);                    
schedules.Add(new ScheduleForm()                    
{                        
Id = i++,                       
StartTime = StartDate,                        
EndTime = EndDate,                        
Subject = entry.Subject.Value,                        
Description = entry.Description,                        
Location = entry.Location});                
}
}        
}
}    
public class ScheduleForm    
{        
public int Id { get; set; }        
public DateTime StartTime { get; set; }        
public DateTime EndTime { get; set; }        
public string Subject { get; set; }        
public string Description { get; set; }        
public string Location { get; set; }    
}
}