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

Double-click goes to another page

10 Answers 92 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Barry
Top achievements
Rank 1
Barry asked on 14 Sep 2011, 09:12 PM
I want to be able to double-click the scheduleview and instead of having an appointment dialog pop up I would like to have it take me to another page for both entering and editing appointments. How can I do this?

10 Answers, 1 is accepted

Sort by
0
Barry
Top achievements
Rank 1
answered on 15 Sep 2011, 02:04 PM
Okay, I've managed to capture the ShowDialog event and cancel the pop up, then I send the user to another view. This works great if there is an appointment that they are clicking on, if they click on an empty space that has no appointment then I get an error.

Private Sub ScheduleView_ShowDialog(sender As Object, e As ShowDialogEventArgs) Handles svTasks.ShowDialog
        ' Cancel the pop up window
        e.Cancel = True
        ' Get the task id of the current appointment, 0 if nothing - which means new task
        Dim task As New ParsTask
        If svTasks.CurrentAppointment IsNot Nothing Then
            task = TryCast(svTasks.CurrentAppointment, ParsTask)
        End If
        ' Send user to detail view
        Dim url As String = String.Format("Task/{0}", task.TaskId)
        MainView.MainContentFrame.Navigate(New Uri(url, UriKind.Relative))
    End Sub

This is the error I get:

{System.ArgumentException: The value " : 9/12/2011 8:00:00 AM - 9/16/2011 5:00:00 PM" is not of type "MCPIC.PARS.Web.Silverlight.ParsTask" and cannot be used in this generic collection.
Parameter name: value
   at System.ThrowHelper.ThrowWrongValueTypeArgumentException(Object value, Type targetType)
   at System.Collections.ObjectModel.Collection`1.System.Collections.IList.Add(Object value)
   at Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.HackCollectionViewBug(Boolean isCommit)
   at Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.CancelNew()
   at Telerik.Windows.Controls.ScheduleViewBase.Cancel()
   at Telerik.Windows.Controls.ScheduleViewBase.OpenAppointmentDialog(Occurrence occurrence, AppointmentViewMode viewMode)
   at Telerik.Windows.Controls.ScheduleViewBase.CreateAppointmentWithDialog(Object parameter)
   at Telerik.Windows.Controls.ScheduleViewBase.OnCreateAppointmentExecuted(Object sender, ExecutedRoutedEventArgs e)
   at Telerik.Windows.Controls.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   at Telerik.Windows.Controls.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
   at Telerik.Windows.Controls.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at Telerik.Windows.Controls.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at Telerik.Windows.Controls.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   at Telerik.Windows.Controls.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
   at Telerik.Windows.RadRoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs)
   at Telerik.Windows.RouteItem.InvokeHandler(RadRoutedEventArgs routedEventArgs)
   at Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain)
   at Telerik.Windows.EventRoute.InvokeHandlers(Object source, RadRoutedEventArgs args)
   at Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args)
   at Telerik.Windows.DependencyObjectExtensions.RaiseEvent(DependencyObject element, RadRoutedEventArgs e)
   at Telerik.Windows.Controls.RoutedCommand.ExecuteImpl(Object parameter, UIElement target)
   at Telerik.Windows.Controls.RoutedCommand.Execute(Object parameter, UIElement target)
   at Telerik.Windows.Controls.CommandManager.ExecuteCommand(RoutedCommand routedCommand, Object parameter, UIElement target, RoutedEventArgs inputEventArgs)
   at Telerik.Windows.Controls.CommandManager.TranslateInput(UIElement targetElement, RoutedEventArgs args)
   at Telerik.Windows.Controls.CommandManager.OnElementEvent(Object sender, RoutedEventArgs e)
   at Telerik.Windows.Input.Mouse.RaiseMouseButtonEventImpl(DependencyObject element, RoutedEvent routedEvent, MouseButton button, MouseButtonState state, MouseButtonEventArgs e)
   at Telerik.Windows.Input.Mouse.OnElementMouseLeftButtonUp(Object sender, MouseButtonEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)}

": 9/12/2011 8:00:00 AM - 9/16/2011 5:00:00 PM" is the current date range in view on the scheduleview.

Any ideas? Do I need to cancel another event like AppointmentCreating or something? What's going on? This only happens if you click on blank (empty appointments) space.
0
Barry
Top achievements
Rank 1
answered on 15 Sep 2011, 02:13 PM
By the way, I tried cancelling AppointmentCreating and I get the same error.
0
Barry
Top achievements
Rank 1
answered on 15 Sep 2011, 04:25 PM
I have a custom appointment class that inherits 'Appoinment' and I'm guessing that it is trying to add an 'Appointment' to my collection of custom appointments called 'ParsTask' when I click on an empty space... so how do I get it to stop trying?
0
Konstantina
Telerik team
answered on 20 Sep 2011, 12:05 PM
Hi Barry,

Could you please share with us which version of the controls you are using?
If it is not the latest, could you please test with it and let us know if you still experience the issue.

Regards,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Barry
Top achievements
Rank 1
answered on 20 Sep 2011, 12:44 PM
Hi Konstantina ,

I'm using 2011_1_0419_Dev... the controls that I use are a company purchase and I don't control the license so it would take some work for me to get the latest version of 2011.2.712 (if that is correct)... can you tell me if the latest version will resolve the issue that I'm having? Because if it does not then I don't want to go through the trouble of trying to get the latest from whoever controls the license.
0
Accepted
Konstantina
Telerik team
answered on 22 Sep 2011, 01:21 PM
Hello Barry,

Yes, this bug is fixed in the latest version. Now, Q2 2011 SP1 is available - you will find it in the download section of the licence account.

Please let us know if you experience any difficulties downloading the controls.

Kind regards,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Barry
Top achievements
Rank 1
answered on 22 Sep 2011, 04:10 PM
Ok, I've updated to the most recent version... 2011.2.712.1040 (Dev) and now it doesn't crash on clicking empty appointments - it takes me to the page that I want to go to, but it does crash when clicking on appointments now... I get an error about the timezone cannot be null?? The error:

at System.TimeZoneInfo.ConvertTime(DateTime dateTime, TimeZoneInfo destinationTimeZone)
at Telerik.Windows.Controls.AppointmentDialogViewModel..ctor(Occurrence occurrence, AppointmentViewMode viewMode, ISchedulerDialogHost dialogHost, IEnumerable`1 resourceTypes, IEnumerable`1 timeMarkers, IEnumerable`1 categories)
at Telerik.Windows.Controls.ScheduleViewBase.CreateAppointmentDialogViewModel(Occurrence occurrence, AppointmentViewMode viewMode)
at Telerik.Windows.Controls.ScheduleViewBase.OpenAppointmentDialog(Occurrence occurrence, AppointmentViewMode viewMode)
at Telerik.Windows.Controls.ScheduleViewBase.OpenEditDialog(Occurrence occurrence, Boolean isEditable)
at Telerik.Windows.Controls.ScheduleViewBase.EditWithDialog(IAppointment appointment)
at Telerik.Windows.Controls.ScheduleViewBase.EditWithDialog(IOccurrence occ)
at Telerik.Windows.Controls.ScheduleViewBase.OnEditAppointmentExecuted(Object sender, ExecutedRoutedEventArgs e)
at Telerik.Windows.Controls.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
at Telerik.Windows.Controls.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
at Telerik.Windows.Controls.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
at Telerik.Windows.Controls.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
at Telerik.Windows.Controls.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
at Telerik.Windows.Controls.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
at Telerik.Windows.RadRoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs)
at Telerik.Windows.RouteItem.InvokeHandler(RadRoutedEventArgs routedEventArgs)
at Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain)
at Telerik.Windows.EventRoute.InvokeHandlers(Object source, RadRoutedEventArgs args)
at Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args)
at Telerik.Windows.DependencyObjectExtensions.RaiseEvent(DependencyObject element, RadRoutedEventArgs e)
at Telerik.Windows.Controls.RoutedCommand.ExecuteImpl(Object parameter, UIElement target)
at Telerik.Windows.Controls.RoutedCommand.Execute(Object parameter, UIElement target)
at Telerik.Windows.Controls.CommandManager.ExecuteCommand(RoutedCommand routedCommand, Object parameter, UIElement target, RoutedEventArgs inputEventArgs)
at Telerik.Windows.Controls.CommandManager.TranslateInput(UIElement targetElement, RoutedEventArgs args)
at Telerik.Windows.Controls.CommandManager.OnElementEvent(Object sender, RoutedEventArgs e)
at Telerik.Windows.Input.Mouse.RaiseMouseButtonEventImpl(DependencyObject element, RoutedEvent routedEvent, MouseButton button, MouseButtonState state, MouseButtonEventArgs e)
at Telerik.Windows.Input.Mouse.OnElementMouseLeftButtonDown(Object sender, MouseButtonEventArgs e)
at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)

When I click on a new (empty space) appointment on the calendar it hits the ShowDialog event and I can cancel it and transfer the page with the NavigationService, but when I click on an actual appointment it doesn't even get a chance to get to the ShowDialog event to be cancelled, it dies before it can get there with the Timezone error.

I am pretty sure that this is something that I am doing in my implementation now, because I created a sample project with just the basics using the custom appointment class that I have and the most current version of the control and it works just fine in that project. What could I be doing to have the timezone be null? Especially when it is not null in the sample...
0
Barry
Top achievements
Rank 1
answered on 22 Sep 2011, 04:28 PM
Ok, that WAS my implementation... I had the time zone on my appointment class set to nothing because I'm not using the time zone for anything. I set a time zone on that and it seems to work now. It is funny how it worked before with the time zone as nothing...
0
Konstantina
Telerik team
answered on 26 Sep 2011, 03:13 PM
Hello Barry,

We are glad that you have resolved the issue yourself.
Issues with the time zone are fixed in the Q1 2011 SP1 from 20th September. You can try with it and let us know if that helped.

Greetings,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Barry
Top achievements
Rank 1
answered on 26 Sep 2011, 03:21 PM
As I said, there wasn't really an issue with the time zone, I just had it set to nothing. Once I set it to a time zone it worked fine. I don't know if having or not having a time zone makes any difference for what I'm trying to do... but it doesn't seem like it is being used in any way.
Tags
ScheduleView
Asked by
Barry
Top achievements
Rank 1
Answers by
Barry
Top achievements
Rank 1
Konstantina
Telerik team
Share this question
or