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,
You can use the AddEvent method to add a new Event to the Scheduler.
` private void SchedulerReady(Scheduler scheduler)
{
DateTime today = DateTime.Today;
scheduler.AddEvent(new SchedulerDataSource()
{
Label = “1Google AdWords Strategy”,
DateStart = new DateTime(today.Year, today.Month, today.Day, 9, 0, 0),
DateEnd = new DateTime(today.Year, today.Month, today.Day, 10, 30, 0).AddDays(1),
AllDay = true,
BackgroundColor = “#3F51B5”
});
}`
another way is to set the DataSource property of the Scheduler to a new List.
Best regards,
Peter Stoev
Smart UI Team
https://www.htmlelements.com/