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

Customize EditAppointmentDialog

1 Answer 46 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Derek
Top achievements
Rank 1
Derek asked on 06 Mar 2014, 05:31 PM
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.






1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 11 Mar 2014, 12:21 PM
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.

Tags
Scheduler and Reminder
Asked by
Derek
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or