Get information out of customfields in an appointment

4 posts, 0 answers
  1. Bjorn
    Bjorn avatar
    4 posts
    Member since:
    Jan 2014

    Posted 16 Jan 2014 Link to this post

    I have add a couple of extra fields in a CustomEditAppointmentDialog.
    When i select an appointment in the scheduler I want to put the information out of one of the extra
    fields in a textbox on my form.

    I can reach all the information in the standard fields from Appointment class. But i can't reach the
    information of the extra fields created in the CustomAppointment class.

    Can someone help me out how i can reach that information?

        private void radScheduler1_AppointmentSelected(object sender, SchedulerAppointmentEventArgs e)
        {
            if (e.Appointment.Description != null)
            {
                labelCalendarCustomerNo.Text = e.Appointment.CustNo; //this does not work
                labelCalendarCustomerName.Text = e.Appointment.Location; //this works
                labelCalendarEnd.Text = e.Appointment.End.ToString(); //this works
                labelCalendarStart.Text = e.Appointment.Start.ToString(); //this works
            }
        }
    }


    public class CustomAppointment : Appointment
       {
           public CustomAppointment()
               : base()
           {
           }
           private string custNo = String.Empty;
           public string CustNo
           {
               get
               {
                   return this.custNo;
               }
               set
               {
                   if (this.custNo != value)
                   {
                       this.custNo = value;
                   }
               }
           }
  2. wehbi
    wehbi avatar
    6 posts
    Member since:
    Jun 2010

    Posted 16 Jan 2014 Link to this post

    you have to cast the appointment into your Custom appointment 
    try this

    labelCalendarCustomerNo.Text == ((CustomAppointment)e.Appointment).CustNo;
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Bjorn
    Bjorn avatar
    4 posts
    Member since:
    Jan 2014

    Posted 17 Jan 2014 Link to this post

    Thank you. That is the solutions what I was searching for.
  5. George
    Admin
    George avatar
    500 posts

    Posted 21 Jan 2014 Link to this post

    Hello Guys,

    Bjorn, I am glad that you found a solution to your problem.

    Wehbi, I have added Telerik Points for contributing to the community.

    Do not hesitate to contact us, should you have further questions.

    Regards,
    George
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top