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

Get information out of customfields in an appointment

3 Answers 30 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Bjorn
Top achievements
Rank 1
Bjorn asked on 16 Jan 2014, 10:52 AM
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;
               }
           }
       }

3 Answers, 1 is accepted

Sort by
0
wehbi
Top achievements
Rank 1
answered on 16 Jan 2014, 02:11 PM
you have to cast the appointment into your Custom appointment 
try this

labelCalendarCustomerNo.Text == ((CustomAppointment)e.Appointment).CustNo;
0
Bjorn
Top achievements
Rank 1
answered on 17 Jan 2014, 01:18 PM
Thank you. That is the solutions what I was searching for.
0
George
Telerik team
answered on 21 Jan 2014, 10:01 AM
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 >>
Tags
Scheduler and Reminder
Asked by
Bjorn
Top achievements
Rank 1
Answers by
wehbi
Top achievements
Rank 1
Bjorn
Top achievements
Rank 1
George
Telerik team
Share this question
or