We are wondering how to access the low-level appointment data (like recordset ID or internal references) in order to duplicate a selected appointment including all its settings to a new date in timeline view (v. Q2_2009).
We were looking at the exposed properties without finding something, but I guess we certainly missed something...
Edit: The selection of the appointment occurs through a contextual menu.
This has to be done server-side for technical reasons.
Anybody has an idea?
6 Answers, 1 is accepted
In addition to Robert's suggestion, we have recently had a question on how to copy and paste an appointment using the context menu. Here is sample code for this functionality:
Attached is a simple demo for reference.
the Telerik team
I basically have the desired result I want except my calendar is not rebinding once I insert my record into the database. I have to close and rerun the page to see the new appointment. Here is my code...
Private Sub RadScheduler1_TimeSlotContextMenuItemClicking(sender As Object, e As TimeSlotContextMenuItemClickingEventArgs) Handles RadScheduler1.TimeSlotContextMenuItemClicking
If Session("appointment") IsNot Nothing Then
Dim oSched1 As Appointment = Session("appointment")
Dim oSched2 As Appointment = Nothing
Dim appDuration As TimeSpan = oSched1.Duration
oSched1.Start = e.TimeSlot.Start
oSched1.End = e.TimeSlot.Start.Add(appDuration)
Dim oScheduledShipment As New tScheduledShipment
Dim oNewShipment As New tScheduledShipment
.ShipmentID = oSched1.Attributes.Item("ShipmentID")
.OriginAssetID = oSched1.Attributes.Item("OriginAssetID")
.DestinationID = oSched1.Attributes.Item("DestinationID")
.Vessel = oSched1.Attributes.Item("Vessel")
.CarrierID = oSched1.Attributes.Item("CarrierID")
.ScheduledTons = oSched1.Attributes.Item("ScheduledTons")
.ScheduledShipDate = oSched1.Start
.ExpectedArrivalDate = oSched1.End
.ActionID = 1
.ActionBy = "chrisruckman"
.ActionMachine = "abc"
.ActionDate = Date.Now
Using o As New CIMSLogisticsService.ScheduledShipmentsClient
oNewShipment = o.InsertScheduledShipment(oScheduledShipment)
oSched2 = New Appointment
oSched2.Attributes("ScheduledShipmentID") = .ScheduledShipmentID
oSched2.Attributes("ShipmentID") = .ShipmentID
oSched2.Attributes("OriginAssetID") = .OriginAssetID
oSched2.Attributes("DestinationID") = .DestinationID
oSched2.Attributes("Vessel") = .Vessel
oSched2.Attributes("CarrierID") = .CarrierID
oSched2.Attributes("ScheduledTons") = .ScheduledTons
oSched2.Attributes("ScheduledShipDate") = .ScheduledShipDate
oSched2.Attributes("ExpectedArrivalDate") = .ExpectedArrivalDate
oSched2.Attributes("ActionID") = .ActionID
oSched2.Attributes("ActionBy") = .ActionBy
oSched2.Attributes("ActionMachine") = .ActionMachine
oSched2.Attributes("ActionDate") = .ActionDate
'RadScheduler1.DataSource = ScheduledShipments()
I fixed it. My ScheduledShipments wasn't populating the datasource because it was checking to see if a session variable was being set. I simply set the session variable to nothing and called the ScheduledShipments to set the data and called the scheduler's databind methog. I removed .Rebind because it was undoing the databind()
RadScheduler1.DataSource = Nothing
Session(SCHEDULEDSHIPMENTS_DATA) = Nothing
RadScheduler1.DataSource = ScheduledShipments()
Thank you for shearing the approach you have chosen, in order to resolve the issue faced.
Telerik by Progress