RadScheduler custom view

5 posts, 0 answers
  1. Raaz
    Raaz avatar
    11 posts
    Member since:
    Jan 2013

    Posted 02 Jul 2013 Link to this post

    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
      
  2. Prithvi
    Prithvi avatar
    5 posts
    Member since:
    Sep 2012

    Posted 02 Jul 2013 Link to this post

    hi,

    I have also facing this problem .. any one Help pls its urgent...
  3. UI for WinForms is Visual Studio 2017 Ready
  4. George
    Admin
    George avatar
    500 posts

    Posted 04 Jul 2013 Link to this post

    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 >>
  5. Flavio
    Flavio avatar
    22 posts
    Member since:
    Jan 2011

    Posted 12 Feb 2015 in reply to George Link to this post

    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.
  6. Hristo Merdjanov
    Admin
    Hristo Merdjanov avatar
    710 posts

    Posted 17 Feb 2015 Link to this post

    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.

     
Back to Top
UI for WinForms is Visual Studio 2017 Ready