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

RadScheduler custom view

4 Answers 137 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Raaz
Top achievements
Rank 2
Raaz asked on 02 Jul 2013, 09:44 AM
Hi,

I am facing problem regarding radScheduler .
ex: I have added custom Email field in appointment dialoge, now I want to show this custom email in main radScheduler window where all appointment are listed by day view , month view etc...
Below are the attached images to show you the scenario
  

4 Answers, 1 is accepted

Sort by
0
Prithvi
Top achievements
Rank 1
answered on 02 Jul 2013, 09:53 AM
hi,

I have also facing this problem .. any one Help pls its urgent...
0
George
Telerik team
answered on 04 Jul 2013, 12:20 PM
Hi Rajkumar and Prithvi,

Thank you for contacting us.

To show the email in the main scheduler window there are a two steps you should take. First you need to override the ToString method in the AppointmentWithEmail class.
public override string ToString()
{
    return string.Format("{0} to {1} Email - {2}", this.Start, this.End , this.Email);
}

Then, subscribe to the AppointmentAdded event of the scheduler and change the default format.
void radScheduler1_AppointmentAdded(object sender, AppointmentAddedEventArgs e)
{
    this.radScheduler1.AppointmentTitleFormat = e.Appointment.ToString();
}

I hope you will find this helpful. 

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 >>
0
Flavio
Top achievements
Rank 1
answered on 12 Feb 2015, 03:26 PM
Hi!
I followed your tip, but when I save a new appointment, always appears with details of the last appointment which I saved. I implemented what you said in your tip, but doesn't worked. Do you have any idea why didn't worked?

void schAgenda_AppointmentAdded(object sender, AppointmentAddedEventArgs e)
       {
           this.schAgenda.AppointmentTitleFormat = e.Appointment.ToString();
       }
 
public class FormularioCustomizado : Appointment
   {
       public FormularioCustomizado()
           : base() { }
 
       private Guid guidId; // Esse campo fica invisivel, somente para saber se é um compromisso Novo ou Editado
       private DateTime? dataLembrete = DateTime.Now;
       private DateTime? horaLembrete = DateTime.Now;
       private bool compartilhar = true;
       private string nomeUsuario;
 
       public Guid GuidId
       {
           get
           {
               return guidId;
           }
           set
           {
               if (this.guidId != value)
               {
                   guidId = value;
               }
           }
       }      
     
       public DateTime? DataLembrete
       {
           get { return this.dataLembrete; }
 
           set
           {
               if (this.dataLembrete != value)
               {
                   this.dataLembrete = value;
                   this.OnPropertyChanged("DataLembrete");
               }
           }
       }
       public DateTime? HoraLembrete
       {
           get { return this.horaLembrete; }
 
           set
           {
               if (this.horaLembrete != value)
               {
                   this.horaLembrete = value;
                   this.OnPropertyChanged("HoraLembrete");
               }
           }
       }
 
       public bool Compartilhar
       {
           get
           {
               return compartilhar;
           }
           set
           {
               if (this.compartilhar != value)
               {
                   this.compartilhar = value;
                   this.OnPropertyChanged("Compartilhar");
               }
           }
       }
 
       public string NomeUsuario
       {
           get
           {
               return nomeUsuario;
           }
           set
           {
               if (this.nomeUsuario != value)
               {
                   this.nomeUsuario = value;
                   this.OnPropertyChanged("Compartilhar");
               }
           }
       }
 
       protected override Event CreateOccurrenceInstance()
       {
           FormularioCustomizado _formulario = new FormularioCustomizado();
           _formulario.dataLembrete = this.dataLembrete;
           _formulario.horaLembrete = this.horaLembrete;
           _formulario.guidId = this.guidId;
           return _formulario;
       }
       public override string ToString()
       {
           return string.Format("{0}  {1:HH:mm} à {2:HH:mm} {3} {4}", this.nomeUsuario,  this.Start, this.End, this.Subject, this.Location);
       }


Thanks for your quick reply!
Regards,
Maia.
0
Hristo
Telerik team
answered on 17 Feb 2015, 10:56 AM
Hi Flavio,

Thank you for writing.

As you have noticed, setting the AppointmentTitleFormat in the handler of the AppointmentAdded event will assign a new value of the property which is global for the whole RadScheduler. That is why the summary of the last appointment overrides the summaries of all other appointments as it comes from its ToString method override. In a case like yours, the right thing to do is to set the Summary property of the Appointment object which you receive as an argument. Please my code snippet below: 
void radScheduler1_AppointmentAdded(object sender, AppointmentAddedEventArgs e)
{
    e.Appointment.Summary = e.Appointment.ToString();
}

Additional information about the AppointmentTitleFormat property you can find here. I am additionally sending you a screenshot of the result on my end.

Regards,
Hristo Merdjanov
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.

 
Tags
Scheduler and Reminder
Asked by
Raaz
Top achievements
Rank 2
Answers by
Prithvi
Top achievements
Rank 1
George
Telerik team
Flavio
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or