How to get appointmet id of a selected radscheduler appointment

9 posts, 0 answers
  1. Ananthan
    Ananthan avatar
    8 posts
    Member since:
    Mar 2013

    Posted 15 Apr 2013 Link to this post

    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 ?
  2. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 18 Apr 2013 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Gaston
    Gaston avatar
    7 posts
    Member since:
    Aug 2013

    Posted 17 Nov 2014 in reply to Stefan Link to this post

    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?
  5. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 18 Nov 2014 Link to this post

    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.

     
  6. Gaston
    Gaston avatar
    7 posts
    Member since:
    Aug 2013

    Posted 18 Nov 2014 in reply to Stefan Link to this post

    You pretty much answered the question. I was looking for the unique id.
  7. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 18 Nov 2014 Link to this post

    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.

     
  8. Gaston
    Gaston avatar
    7 posts
    Member since:
    Aug 2013

    Posted 18 Nov 2014 in reply to Stefan Link to this post

    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
  9. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 19 Nov 2014 Link to this post

    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.

     
  10. Gaston
    Gaston avatar
    7 posts
    Member since:
    Aug 2013

    Posted 19 Nov 2014 in reply to Stefan Link to this post

    Thank you very much it worked
Back to Top
UI for WinForms is Visual Studio 2017 Ready