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

change/add descripttion when update an appointment

4 Answers 70 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Allen
Top achievements
Rank 1
Allen asked on 02 Aug 2012, 02:54 PM
I trying to add a description "Override" when update an appointment. 

 

I'm using e.ModifiedAppointment.Description = "Override", but it doesn't work.
Here is my scripts:

 

Protected Sub MyAvailability1_AppointmentUpdate(sender As Object, e As AppointmentUpdateEventArgs) Handles RadScheduler1.AppointmentUpdate
        Dim scheduler As RadScheduler = DirectCast(sender, RadScheduler)
        If e.ModifiedAppointment.Subject = "Preference" Then
            For Each app As Appointment In scheduler.Appointments.GetAppointmentsInRange(e.ModifiedAppointment.Start, e.ModifiedAppointment.[End])

                If app.Subject = "Availability" Then
                    If app.Start > e.ModifiedAppointment.Start OrElse app.[End] < e.ModifiedAppointment.[End] Then
                        e.Cancel = True
                    End If
                End If

            Next
        End If

        If e.ModifiedAppointment.Subject = "Availability" Then
            For Each app As Appointment In scheduler.Appointments.GetAppointmentsInRange(e.ModifiedAppointment.Start, e.ModifiedAppointment.[End])

                If app.Subject = "Preference" Then
                    If app.Start < e.ModifiedAppointment.Start OrElse app.[End] > e.ModifiedAppointment.[End] Then
                        e.Cancel = True
                    End If
                End If
            Next
        End If
        e.ModifiedAppointment.Description = "Override"
    End Sub

4 Answers, 1 is accepted

Sort by
0
Ivana
Telerik team
answered on 06 Aug 2012, 02:00 PM
Hi Allen,

The following definition of RadScheduler works when I test it locally:
<telerik:RadScheduler ID="RadScheduler1" runat="server" EnableDescriptionField="true" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate">
</telerik:RadScheduler>
Protected Sub RadScheduler1_AppointmentUpdate(sender As Object, e As AppointmentUpdateEventArgs)
    e.ModifiedAppointment.Description = e.ModifiedAppointment.Description + " description added!"
End Sub

What is the version of RadControls for ASP.NET AJAX that you use in your  application?

Kind regards,
Ivana
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Allen
Top achievements
Rank 1
answered on 07 Aug 2012, 07:13 PM
I have tried this one, but it is not updating the Appointments.XML file.
My XML file:
<?xml version="1.0" encoding="utf-8"?>
<Appointments>
  <NextID>69</NextID>
  <Appointment>
    <ID>52</ID>
    <Subject>Preference</Subject>
    <Start>2012-06-10T09:00Z</Start>
    <End>2012-06-10T22:00Z</End>
    <Description></Description>
  </Appointment>
  <Appointment>
    <ID>53</ID>
    <Subject>Preference</Subject>
    <Start>2012-06-11T09:30Z</Start>
    <End>2012-06-11T20:30Z</End>
    <Description></Description>
  </Appointment>
  <Appointment>
    <ID>54</ID>
    <Subject>Preference</Subject>
    <Start>2012-06-12T10:00Z</Start>
    <End>2012-06-12T18:00Z</End>
    <Description></Description>
  </Appointment>
  <Appointment>
    <ID>55</ID>
    <Subject>Preference</Subject>
    <Start>2012-06-13T10:30Z</Start>
    <End>2012-06-13T18:00Z</End>
    <Description></Description>
  </Appointment>
  <Appointment>
    <ID>56</ID>
    <Subject>Preference</Subject>
    <Start>2012-06-14T15:00Z</Start>
    <End>2012-06-14T21:30Z</End>
    <Description></Description>
  </Appointment>
  <Appointment>
    <ID>57</ID>
    <Subject>Preference</Subject>
    <Start>2012-06-15T09:00Z</Start>
    <End>2012-06-15T13:00Z</End>
    <Description></Description>
  </Appointment>
  <Appointment>
    <ID>58</ID>
    <Subject>Availability</Subject>
    <Start>2012-06-10T10:30Z</Start>
    <End>2012-06-10T21:00Z</End>
    <Description></Description>
    <TimeZoneID>UTC</TimeZoneID>
  </Appointment>
  <Appointment>
    <ID>59</ID>
    <Subject>Availability</Subject>
    <Start>2012-06-11T09:30Z</Start>
    <End>2012-06-12T00:00Z</End>
    <Description></Description>
    <TimeZoneID>UTC</TimeZoneID>
  </Appointment>
  <Appointment>
    <ID>60</ID>
    <Subject>Availability</Subject>
    <Start>2012-06-12T09:00Z</Start>
    <End>2012-06-12T19:00Z</End>
    <Description></Description>
  </Appointment>
  <Appointment>
    <ID>61</ID>
    <Subject>Availability</Subject>
    <Start>2012-06-13T08:30Z</Start>
    <End>2012-06-13T18:30Z</End>
    <Description></Description>
  </Appointment>
  <Appointment>
    <ID>62</ID>
    <Subject>Availability</Subject>
    <Start>2012-06-14T13:00Z</Start>
    <End>2012-06-14T22:30Z</End>
    <Description></Description>
  </Appointment>
  <Appointment>
    <ID>63</ID>
    <Subject>Availability</Subject>
    <Start>2012-06-15T08:30Z</Start>
    <End>2012-06-15T16:00Z</End>
    <Description></Description>
    <TimeZoneID>UTC</TimeZoneID>
  </Appointment>
  <Appointment>
    <ID>64</ID>
    <Subject>Availability</Subject>
    <Start>2012-06-16T11:00Z</Start>
    <End>2012-06-16T23:30Z</End>
    <Description></Description>
  </Appointment>
  <Appointment>
    <ID>65</ID>
    <Subject>Preference</Subject>
    <Start>2012-06-16T13:30Z</Start>
    <End>2012-06-16T19:30Z</End>
    <Description></Description>
  </Appointment>
</Appointments>
0
Allen
Top achievements
Rank 1
answered on 07 Aug 2012, 07:15 PM
Another question is that can i do this on the client side? 
0
Ivana
Telerik team
answered on 09 Aug 2012, 03:01 PM
Hello Allen,

Make sure that you have enabled the description field of RadScheduler  -- it is enabled by setting the property EnableDescriptionField to 'True'.

The following help article contains information on how to to access the controls inside the advanced form of RadScheduler: http://www.telerik.com/help/aspnet-ajax/scheduler-customizing-advanced-form-javascript-jquery-css.html.

All the best,
Ivana
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
Allen
Top achievements
Rank 1
Answers by
Ivana
Telerik team
Allen
Top achievements
Rank 1
Share this question
or