JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Scheduler › [Blazor Scheduler]How to add an item to a scheduler datasource from an event › Reply To: [Blazor Scheduler]How to add an item to a scheduler datasource from an event
Hi Lukas,
Adding/Updating items of a List generally doesn’t trigger UI updates. You can notify Blazor by assigning the List to itself. For example:
var newEvent = new SchedulerDataSource()
{
Label = “Review Revenue Projections”,
DateStart = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 11, 45, 0),
DateEnd = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 15, 0, 0),
};
dataSource.Add(newEvent);
// Reassign dataSource to trigger UI update
dataSource = new List<SchedulerDataSource>(dataSource);
Best regards,
Ivan Peevski
Smart UI Team
https://www.htmlelements.com/