AppointmentFormatting depending on actual Resource possible?

2 Answers 34 Views
Scheduler and Reminder
Stephan
Top achievements
Rank 3
Bronze
Iron
Iron
Stephan asked on 27 Sep 2023, 06:04 PM | edited on 27 Sep 2023, 06:05 PM

Hello, I am using a scheduler, where my appointments can have multiple resources. A resource can be the a casual member or be responsible for the appointment. I want to achieve a custom formatting of the appointment element, depending on the following states:

- the current resource is the only member (automatically responsible)
- the current resource is member, but not responsible
- the current resource is responsible and appointment has other members.

The attached screenshot shows a single appointment with 2 members and a responsible. The drawn Icon shall be depending on the resource of the current row.

To achieve that task, I want to implement the AppointmentFormatting-Event and set the Icon of the AppointmentElement depending on the relative resouce state. But how do I determine the current resouce of the AppointmentElement?

Regards Stephan

 

Stephan
Top achievements
Rank 3
Bronze
Iron
Iron
commented on 28 Sep 2023, 08:22 AM | edited

...

2 Answers, 1 is accepted

Sort by
0
Accepted
Nadya | Tech Support Engineer
Telerik team
answered on 28 Sep 2023, 09:55 AM

Hello, Stephan,

I am glad that you have found out how to get the ResourceId when handling the AppointmentFormatting event. I am posting the following code snippet here so that other clients can benefit from it:

private void RadScheduler1_AppointmentFormatting(object sender, SchedulerAppointmentEventArgs e)
{
   EventId resourceID = e.AppointmentElement.View.GetResourceId();
}

In case you have any other questions do not hesitate to contact us.

Regards,
Nadya
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
Stephan
Top achievements
Rank 3
Bronze
Iron
Iron
answered on 28 Sep 2023, 08:43 AM

Nevermind,

find the Solution today: schedulerAppointmentEventArgs.AppointmentElement.View.GetResource() or schedulerAppointmentEventArgs.AppointmentElement.View.GetResourceId()
Tags
Scheduler and Reminder
Asked by
Stephan
Top achievements
Rank 3
Bronze
Iron
Iron
Answers by
Nadya | Tech Support Engineer
Telerik team
Stephan
Top achievements
Rank 3
Bronze
Iron
Iron
Share this question
or