Skip to content

Scheduler: Load Appointments dynamically #6514

@stsrki

Description

@stsrki

Discussed in #6513

Originally posted by tomasautonet April 9, 2026
Hi,

I'm trying to load the appointments dynamically by listening to the DateChanged event and then load the appointments for the current view from the server. The problem is that the scheduler doesn't seem to react if the list assigned to Data changes. Also I cannot find any public "Refresh" method.

Any suggestions? My code is below

<Scheduler Data="@SchedulerItems"
           Date="@_schedulerDate"
           SelectedView="@_schedulerSelectedView"
           Editable="false"
           UseInternalEditing="false"
           Draggable="false"
           DateChanged="OnSchedulerDateChanged"
           SelectedViewChanged="OnSchedulerViewChanged"
           EditItemClicked="OnSchedulerItemClicked"
           ItemStyling="OnItemStyling">


private async Task OnSchedulerDateChanged(DateOnly newDate)
{
    _schedulerDate = newDate;    
    await LoadBookingsForScheduler();    
}

private async Task LoadBookingsForScheduler()
{
    var (from, to) = GetVisibleDateRange();
    var query = new GetBookingsOverviewQuery { From = from, To = to };
    var response = await Http.PostAsJsonAsync("api/bookings", query);

    if (response.IsSuccessStatusCode)
    {
        var dtos = await response.Content.ReadFromJsonAsync<List<BookingOverviewItemDto>>() ?? [];
        SchedulerItems = dtos.Select(SchedulerBookingItem.FromDto).ToList();
        _schedulerKey++;
    }
}
```</div>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions