Customize EditAppointmentDialog

2 posts, 0 answers
  1. Derek
    Derek avatar
    104 posts
    Member since:
    Aug 2008

    Posted 06 Mar 2014 Link to this post

    Hi, I have two issues. 

    1)  How can I change the title from 'Edit Appointment'

    2)  I programmatically call a custom appointment dialog, but the background dropdown is empty. The code is below, I had to add a New event to the custom dialog in order to get it to work

     Dim app As New Appointment(Now, Now.AddMinutes(30))
     Dim frmeditDialog As EditAppointmentDialogExtended = New EditAppointmentDialogExtended(app, DashBoard.schMain)

      If frmeditDialog.ShowDialog(Me) = DialogResult.OK Then
                        DashBoard.schMain.Appointments.Add(frmeditDialog.Appointment)
      End If


    Here is the New Sub in the custom dialog:

      Sub New(app As Telerik.WinControls.UI.Appointment, radScheduler As RadScheduler)
           _app = app
            _radScheduler = radScheduler

            InitializeComponent()
    End Sub


    Any help is appreciated.






  2. Stefan
    Admin
    Stefan avatar
    2890 posts

    Posted 11 Mar 2014 Link to this post

    Hi Derek,

    Thank you for writing.

    Perhaps you are already aware of this article for creating custom EditAppointmentDialog: http://www.telerik.com/help/winforms/scheduler-appointments-and-dialogs-adding-a-custom-field-to-the-editappointment-dialog.html. To change the text, you can simple override the OnLoad method of your CustomAppointmentEditForm and set the text there. 

    In regards to the missing back ground colors, I was not able to reproduce such a behavior on my end. Here is the dialog I used:
    Public Partial Class CustomAppointmentEditForm
        Inherits EditAppointmentDialog
        Public Sub New()
     
            InitializeComponent()
        End Sub
     
        Protected Overrides Sub OnLoad(e As EventArgs)
            MyBase.OnLoad(e)
            Me.Text = "some text"
        End Sub
     
        Protected Overrides Sub LoadSettingsFromEvent(ev As IEvent)
            MyBase.LoadSettingsFromEvent(ev)
     
            Dim appointmentWithEmail As AppointmentWithEmail = TryCast(ev, AppointmentWithEmail)
            If appointmentWithEmail IsNot Nothing Then
                Me.txtEmail.Text = appointmentWithEmail.Email
            End If
        End Sub
     
        Protected Overrides Sub ApplySettingsToEvent(ev As IEvent)
            Dim appointmentWithEmail As AppointmentWithEmail = TryCast(ev, AppointmentWithEmail)
            If appointmentWithEmail IsNot Nothing Then
                appointmentWithEmail.Email = Me.txtEmail.Text
            End If
            MyBase.ApplySettingsToEvent(ev)
        End Sub
     
        Protected Overrides Function CreateNewEvent() As IEvent
            Return New AppointmentWithEmail()
        End Function
     
        Public ReadOnly Property StartDate() As DateTime
            Get
                Return dateStart.Value
            End Get
        End Property
    End Class
     
    Public Class AppointmentWithEmail
        Inherits Appointment
        Public Sub New()
            MyBase.New()
        End Sub
        Private m_email As String = String.Empty
        Public Property Email() As String
            Get
                Return Me.m_email
            End Get
            Set
                If Me.m_email <> value Then
                    Me.m_email = value
                    Me.OnPropertyChanged("Email")
                End If
            End Set
        End Property
     
        Protected Overrides Function CreateOccurrenceInstance() As [Event]
            Return New AppointmentWithEmail()
        End Function
    End Class

    Off topic, I noticed that your subscription has expired, which means that your support package has expired as well. Note that you will need to renew your subscription in order to continue to receive support from us. To do this, please contact sales@telerik.com or check.

    I have converted this forum thread into a support ticket in order to prevent exporure of private information to the public forums. You can find it in Your Telerik Account 

    Let me know if I can be of further assistance.

    Regards,
    Stefan
    Telerik

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top