This is a migrated thread and some comments may be shown as answers.

How to get appointmet id of a selected radscheduler appointment

8 Answers 312 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Ananthan
Top achievements
Rank 1
Ananthan asked on 15 Apr 2013, 04:26 PM
Hi,
How to get appointment id of a selected rad scheduler appointment  ?
I want the appointment id or can i get the datarow of a selected appointment ?

8 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 18 Apr 2013, 02:06 PM
Hello Ananthan,

Thank you for writing.

I am not sure which id you are referring to, however, here is how you can get the selected appointment in RadScheduler:
void radButton1_Click(object sender, EventArgs e)
{
    AppointmentElement appointmentElement = SchedulerUIHelper.GetSelectedAppointment(radScheduler1);
    Appointment appointment = appointmentElement.Appointment as Appointment;
}

I hope this helps.

All the best,
Stefan
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
Gaston
Top achievements
Rank 1
answered on 17 Nov 2014, 06:08 PM
I think he meant the appointment ID. The code you provided gave me information about the appointment information. How do you get the ID of the appointment?
0
Stefan
Telerik team
answered on 18 Nov 2014, 09:08 AM
Hello,

I am not sure which ID is that you are looking for, however, from the Appointment object you can the following information: BackgroundID, StatusID, RecurrenceID, RemindID, ResourceID, UniqueID.

If this is not what you are looking for, please provide more information about the precise case and I will do my best to help you.

Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Gaston
Top achievements
Rank 1
answered on 18 Nov 2014, 10:40 AM
You pretty much answered the question. I was looking for the unique id.
0
Stefan
Telerik team
answered on 18 Nov 2014, 11:13 AM
I am glad I could help.

Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Gaston
Top achievements
Rank 1
answered on 18 Nov 2014, 03:40 PM
One last question, and forgive me if it is silly one. I am relatively new to c# and tried to use your code to get the unique id
private void RadButton1Click(object sender, EventArgs e)
{
    AppointmentElement appointmentElement = SchedulerUIHelper.GetSelectedAppointment(radScheduler1);
 
    Appointment appId = appointmentElement.Appointment.UniqueId as Appointment;
}
It would give me a compiling error, this is the error
Cannot convert type 'Telerik.WinControls.UI.EventId' to 'Telerik.WinControls.UI.Appointment' via a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type
0
Stefan
Telerik team
answered on 19 Nov 2014, 08:00 AM
Hi,

Here is how to get the ID:
Appointment appointment = appointmentElement.Appointment as Appointment;
int appId = appointment.UniqueId;

Regards,
Stefan
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Gaston
Top achievements
Rank 1
answered on 19 Nov 2014, 10:23 PM
Thank you very much it worked
Tags
Scheduler and Reminder
Asked by
Ananthan
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Gaston
Top achievements
Rank 1
Share this question
or