I'm not sure why this is showing up... How to not show gridview when hovering over an appointment
Second question: In the radScheduler1_AppointmentResizeEnd routine - how do I get the value for the new Start and End time after the appointment has been resized?
Thank you in advance for your assistance
3 Answers, 1 is accepted
I just wanted to post this block of code which show's where I'm having the issue determining the New Start and End Times.
Private Sub radScheduler1_AppointmentResizeEnd(sender As Object, e As SchedulerAppointmentEventArgs) Handles radScheduler1.AppointmentResizeEnd
Dim oSQL As New DAL.SqlServer With {.ConnectionString = _cnQuickboooks}
Dim CalendarAppointmentID As Integer = 0
Dim NewStartTime As DateTime = Nothing
Dim NewEndTime As DateTime = Nothing
Dim appt As Appointment = e.Appointment
If Not e.Appointment.DataItem Is Nothing Then
Dim rowView As DataRowView = TryCast(e.Appointment.DataItem, DataRowView)
If Not rowView Is Nothing Then
CalendarAppointmentID = rowView.Row.Item("id")
Dim duration As TimeSpan = e.Appointment.Duration
Dim DurationMinutes As Integer = duration.Minutes
' I cannot figure out how to get the new start and end times after the user has resized the appointment
' NewStartTime = ?????
' NewEndTime = ?????
End If
Else
End If
UpdateData(CalendarAppointmentID, NewStartTime, NewEndTime)
End Sub
Ok, I figured out what was causing the Grid to appear.
I had copied and pasted an example from the forum - and didn't notice the lines that I rem'd out in the code below.
Taking them out - now causes the grid to "Not Appear" - but, it's good to know anyway.
Private Sub radScheduler1_ScreenTipNeeded(sender As Object, e As ScreenTipNeededEventArgs)
screenTip.MainTextLabel.Padding = New Padding(2)
screenTip.CaptionLabel.Padding = New Padding(2)
screenTip.CaptionLabel.Text = "Caption"
screenTip.MainTextLabel.Text = ""
screenTip.EnableCustomSize = True
'Dim host As New RadHostItem(grid)
'screenTip.Children.Add(host)
screenTip.AutoSize = False
screenTip.Size = New Size(800, 200)
Dim appointmentElement As AppointmentElement = TryCast(e.Item, AppointmentElement)
If appointmentElement IsNot Nothing Then
'bind to appropriate collection of data to display the necessary information
'grid.DataSource = New List(Of IEvent)() From {appointmentElement.Appointment}
Dim Summary As String = appointmentElement.Appointment.Summary
Dim StartTime As String = appointmentElement.Appointment.Start
Dim EndTime As String = appointmentElement.Appointment.End
screenTip.CaptionLabel.Text = Summary
screenTip.MainTextLabel.Text = "From: " & StartTime & " To: " & EndTime
appointmentElement.ScreenTip = screenTip
Application.DoEvents()
End If
End Sub
However, if the Telerik staff or another developer could help me out with finding the NEW Start and End Times on ResizeEnd - it would be greatly appreciated.
Your question about the new start/end time of the appointment in the AppointmentResizeEnd event has been answered in the support ticket that you have opened on the same topic. However, I am posting the answer here as well in order the community to benefit from it.
In the AppointmentResizeEnd event the resize operation has already been completed. Hence, you can get the new start/end time directly from the SchedulerAppointmentEventArgs.Appointment via its Start/End properties.
As to the question about the grid appearing after hovering the scheduler, I am glad you have found out that the ScreenTipNeeded event handler was actually causing it.
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik