Scheduler display duplicate appointment while number of slots goes beyond 20, in timeline view.

2 Answers 21 Views
Scheduler
Sathyendranath
Top achievements
Rank 1
Iron
Iron
Sathyendranath asked on 04 Feb 2025, 04:04 PM

Hi Team,

We are using RadScheduler to display the capacity chart in our application. The scheduler data, including Resources and Appointments, is dynamically retrieved from the database and filtered based on a Start Date and Completion Date. The slots are calculated dynamically according to these date parameters and are set at runtime in the server-side code.

We have observed an issue during data rendering: when the number of slots exceeds 20, appointments appear duplicated in the Timeline View. The issue is illustrated in the attached images.

Could you please confirm if this is a known issue? Additionally, if there is a recommended solution or workaround, we would appreciate your guidance.

Looking forward to your response.

SCENARIO: Appointment appear correctly for 20 slots.

SCENARIO:  Duplicate Appointment appear for  21 slots.

Best Regards

Sathyendranath

2 Answers, 1 is accepted

Sort by
0
Accepted
Sathyendranath
Top achievements
Rank 1
Iron
Iron
answered on 14 Feb 2025, 06:26 AM

Hi Rumen

Thank you for your response.

Upon analyzing the issue, I have identified that data duplication is occurring due to incorrect query logic.

I hope this insight will be helpful to others in the future.

Thanks

Sathyendranath

Rumen
Telerik team
commented on 14 Feb 2025, 09:35 AM

It's great to hear that you were able to identify the root cause. Understanding that the issue stems from incorrect query logic will definitely be helpful for others facing similar challenges.

I have converted your comment into an answer to make it more accessible for future readers.
0
Rumen
Telerik team
answered on 07 Feb 2025, 10:07 AM

Hi Sathyendranath,

Thank you for bringing this issue to our attention and providing information about your scenario. Let me address the problem and suggest potential resolutions.

Currently, there is no documented issue in RadScheduler Timeline View where appointments appear duplicated specifically when the NumberOfSlots exceeds 20. However, based on similar cases we've encountered, this behavior could be influenced by a combination of factors such as data binding, recurring appointments, ViewState handling, or TimelineView configuration.

Troubleshooting and Recommendations

1. Verify Data Binding

Ensure that appointments and resources are fetched and bound to the scheduler without duplication. Duplicates at the data source level can inadvertently cause rendering issues.

Refer to this data binding walkthrough for detailed guidance on properly binding data to the RadScheduler.

To debug, log or inspect the fetched data to confirm that no duplicate entries exist.

2. Optimize TimelineView Configuration

Ensure your TimelineView is correctly configured, particularly when exceeding 20 slots:

<telerik:RadScheduler runat="server" ID="RadScheduler1" SelectedView="TimelineView">
    <TimelineView 
        NumberOfSlots="21" 
        SlotDuration="12:00:00" 
        ColumnHeaderDateFormat="dd/dd<br/>ddd" />
</telerik:RadScheduler>

Tips:

  • Avoid dynamically altering NumberOfSlots at runtime unless absolutely necessary.
  • Ensure that SlotDuration aligns with your time intervals.

3. Handle Recurring Appointments

Duplicate appointments may result from overlapping occurrences. Use server-side validation in the AppointmentInsert and AppointmentUpdate events to detect and prevent conflicts:

protected void RadScheduler1_AppointmentInsert(object sender, AppointmentInsertEventArgs e)
{
    RecurrenceRule recurrenceRule;
    RecurrenceRule.TryParse(e.Appointment.RecurrenceRule, out recurrenceRule);
    if (recurrenceRule != null)
    {
        var occurrences = recurrenceRule.Occurrences;
        // iterate the occurrences and check for duplication with Scheduler appointments
    }
 
    // cancel the Update if a conflict is available
    e.Cancel = true;
}
 
protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
{
    // iterate the occurrences and check for duplication with Scheduler appointments
    RecurrenceRule recurrenceRule;
    RecurrenceRule.TryParse(e.Appointment.RecurrenceRule, out recurrenceRule);
    if (recurrenceRule != null)
    {
        var occurrences = recurrenceRule.Occurrences;
        // iterate the occurrences and check for duplication with Scheduler appointments
    }
 
    // cancel the Update if a conflict is available
    e.Cancel = true;
}

4. Use Resource Availability Demo

The Resource Availability Demo (link) provides an excellent reference for:

  • Preventing overlapping appointments for the same resource.
  • Limiting available resources during appointment creation.

I recommend adapting this demo to your specific requirements.

5. Debug Client-Side and ViewState Issues

If custom client-side logic is involved, ensure that it does not inadvertently duplicate appointments. Use browser developer tools or Telerik’s client-side API to inspect the rendered appointments:

var scheduler = $find("<%= RadScheduler1.ClientID %>");
console.log(scheduler.get_appointments());

6. Upgrade to the latest version:

Test the latest version to see if the problem is not fixed. The latest version supports the latest browsers and offers better security and performance.

Next Steps

  1. Apply the recommendations above to isolate and resolve the issue.
  2. If the problem persists, please create a simplified runnable sample with a scheduler bound to a dummy datasource datatable and share it with us. This will help us investigate further and provide a more tailored solution.

I hope these suggestions help!

    Regards,
    Rumen
    Progress Telerik

    Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
    Tags
    Scheduler
    Asked by
    Sathyendranath
    Top achievements
    Rank 1
    Iron
    Iron
    Answers by
    Sathyendranath
    Top achievements
    Rank 1
    Iron
    Iron
    Rumen
    Telerik team
    Share this question
    or