Is it possible to drag and drop from a grid view to a scheduler then the appointment will be set and save automatically??
For example in the same window I have grid view and scheduler
If there is a person call John in grid view that has a kind of an appointment, so when I drag that person from grid to scheduler the appointment should be automatically added to the selected place and time.
For more detail check the attached picture
Thanks in advance
12 Answers, 1 is accepted

Yes, you can do this. Please open up the Telerik Winforms demons that are on your PC and navigate to the Scheduler demos, and then drag&drop. You will see that this scenario is covered in the demos. I.e there is a demo of a drag drop from RadGridView to RadScheduler to create an appointment.
Hope that helps
Richard

Thanks a lot Richard,,
I tried this small example since I do not know how to use or run demos codes its using some extra classes and such a thing witch is not working well with me.
But I could not understand how to declare the drag object
Dim dragObject As DragObject = TryCast(e.Data.GetData(GetType(DragObject)), DragObject)
This object is giving me an error that it can not be declare
If you have any idea please letme know since it might need to add some reference or such a thing
the above line give me an errror and this two line of code too coz it is related to the above one as I believe
Me.mouseDownPosition = point.Empty
Me.isDragging = False
ublic Class RadForm1
Private Sub radScheduler1_DragDrop(ByVal sender As Object, ByVal e As DragEventArgs)
Dim point As Point = Me.radScheduler1.PointToClient(New Point(e.X, e.Y))
Dim table As DayViewAppointmentsTable = (TryCast(Me.radScheduler1.SchedulerElement.ViewElement, SchedulerDayViewElement)).DataAreaElement.Table
Dim schedulerCell As SchedulerCellElement = SchedulerUIHelper.GetCellAtPoint(point, table.Children)
If schedulerCell IsNot Nothing Then
Dim dragObject As DragObject = TryCast(e.Data.GetData(GetType(DragObject)), DragObject)
If dragObject IsNot Nothing Then
Me.RadScheduler1.Appointments.BeginUpdate()
Dim appointment As Appointment = CreateAppointment(schedulerCell.Date, dragObject)
Me.RadScheduler1.Appointments.Add(appointment)
Me.RadScheduler1.Appointments.EndUpdate()
End If
End If
Me.mouseDownPosition = point.Empty
Me.isDragging = False
End Sub
Private Function CreateAppointment(ByVal currentDate As Date, ByVal dragObject As DragObject) As Appointment
Dim appointment As New Appointment()
Dim startDate As Date = currentDate
Dim endDate As Date = currentDate.AddHours(1)
Select Case dragObject.Status
Case AppointmentFields.Summary
appointment.Summary = TryCast(dragObject.Values(dragObject.Status), String)
Case AppointmentFields.Row
appointment.Summary = TryCast(dragObject.Values(AppointmentFields.Summary), String)
appointment.Description = TryCast(dragObject.Values(AppointmentFields.Description), String)
appointment.BackgroundId = CInt(Fix(dragObject.Values(AppointmentFields.Background)))
appointment.StatusId = CInt(Fix(dragObject.Values(AppointmentFields.Status)))
appointment.Location = TryCast(dragObject.Values(AppointmentFields.Location), String)
startDate = CDate(dragObject.Values(AppointmentFields.Start))
endDate = CDate(dragObject.Values(AppointmentFields.End))
Dim range As TimeSpan = endDate.Subtract(startDate)
endDate = currentDate.Add(range)
startDate = currentDate
End Select
appointment.Start = startDate
appointment.End = endDate
Return appointment
End Function
Private Sub RadScheduler1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadScheduler1.Click
End Sub
Private Enum AppointmentFields
Row
Summary
Location
Description
Start
[End]
Background
Status
End Enum
End Class

It's really easy to get to the examples and you will find everything that you need in there. Just browse to (for exmaple)
C:\Program Files (x86)\Telerik\RadControls for WinForms Q1 2011\Examples\QuickStart and then open the solution which is right for your environment. E.g. ExamplesCSVS2010.sln
Hope that helps
Richard

How about the example I just post >>do you have any idea,,
Dim dragObject As DragObject = TryCast(e.Data.GetData(GetType(DragObject)), DragObject)
For the example I can run the demo and see the code, but my problem was with the code itself it’s giving me an error when I use it after creating a new project

I'm having trouble understanding the issue that you're having. Have you tried the demo example?
Richard

The DragObject is an object that you write yourself that holds the information that you wish to drag. For exmaple, in the demo app, the DragObject is written as follows:
Private
Class
DragObject
Private
status_Renamed
As
AppointmentFields
Private
values_Renamed
As
Dictionary(Of AppointmentFields,
Object
) =
New
Dictionary(Of AppointmentFields,
Object
)()
Public
Property
Status()
As
AppointmentFields
Get
Return
Me
.status_Renamed
End
Get
Set
(
ByVal
value
As
AppointmentFields)
Me
.status_Renamed = value
End
Set
End
Property
Public
ReadOnly
Property
Values()
As
Dictionary(Of AppointmentFields,
Object
)
Get
Return
Me
.values_Renamed
End
Get
End
Property
End
Class
I hope that helps but do let me know if you need further help
Richard
Please remember to mark Richard's reply as answer if you find it helpful. Write back if you have additional questions.
Best wishes,
Ivan Todorov
the Telerik team

how about this two line of code,,
is there is any reference need to be added?
Me.mouseDownPosition = point.Empty
Me.isDragging = False

Can you please let me know how drag and drop work in simple example using scheduler and grid view?
thanks in advance

Aside from the demos that you have already seen on your pc, please also take a look at this forum post which you may find helpful.
Regards,
Richard
Have you managed to get this case working?
Feel free to write if you need further help.
Best wishes,
Ivan Todorov
the Telerik team