We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

TimeLine View with Resources and automatic IntervalHeight

Hello,
I use the SfSchedule control in TimeLine view with Resources and TimeInterval set to ThirtyMin.
I am trying to make the entire day visible without scrolling, so based on this thread:
https://www.syncfusion.com/forums/130291/snapping-to-timeinterval-automatic-intervalheight-and-disabling-edition-for-recurring
I assumed that the following will work:

private void SfSchedule_SizeChanged(object sender, SizeChangedEventArgs e)
{
    Schedule1.IntervalHeight = e.NewSize.Width / 48;
}

When I add an appointment at 12:00 AM with 30 minutes duration and try to drag it to another hour I am getting the following exception:
'-55,6666666666667' is not a valid value for property 'Width'.

StackTrace:

at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Syncfusion.UI.Xaml.Schedule.ScheduleTimeLineView.EnableDragDrop(SfSchedule sfSchedule)
at Syncfusion.UI.Xaml.Schedule.SfSchedule.EnableDragDrop()
at Syncfusion.UI.Xaml.Schedule.ScheduleHorizontalAppointmentViewControl.OnMouseMove(MouseEventArgs e)
at System.Windows.UIElement.OnMouseMoveThunk(Object sender, MouseEventArgs e)
at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at SchedulerBug.App.Main()


What is the proper way to achieve this?

Thank you,
Dimitrios


5 Replies

UN Unknown Syncfusion Team December 3, 2019 12:58 PM UTC

Hi Dimitrios, 
 
Thanks for contacting Syncfusion support. 
 
We are analyzing your query regarding “Drag and drop an appointment results in Exception” and we will update you regarding this query on 5th December 2019. 
 
Regards, 
Niranjan Kumar  



UN Unknown Syncfusion Team December 5, 2019 01:22 PM UTC

Hi Dimitrios, 
 
Thanks for your patience. 
 
We have analyzed your query regarding “Drag and drop an appointment results in Exception” and we are unable to reproduce the reported issue. We have attached an reference video of our working sample below. Please let us know if you have any queries. 
 
 
Regards, 
Niranjan Kumar 
 



DI Dimitrios December 5, 2019 03:23 PM UTC

Hi,
Thanks for your response.
I know that the default setup works fine.
The error occurs with the following setup as I mentioned before:

TimeLine view +
Resources +
TimeInterval=ThirtyMin +
The following SizeChanged event

private void SfSchedule_SizeChanged(object sender, SizeChangedEventArgs e)
{
    Schedule1.IntervalHeight = e.NewSize.Width / 48;
}


The XAML code I use is the following:

<syncfusion:SfSchedule x:Name="Schedule1"
                       ScheduleType="TimeLine"
                       TimeInterval="ThirtyMin"
                       Resource="Doctors"
                       SizeChanged="SfSchedule_SizeChanged"
                       >
    
    <syncfusion:SfSchedule.ScheduleResourceTypeCollection >
        <syncfusion:ResourceType TypeName="Doctors">
            <syncfusion:Resource DisplayName="Dr.Jacob John, M.D" ResourceName="Dr.Jacob" />
            <syncfusion:Resource DisplayName="Dr.Darsy Jane, M.D" ResourceName="Dr.Darsy" />
        </syncfusion:ResourceType>
    </syncfusion:SfSchedule.ScheduleResourceTypeCollection>
</syncfusion:SfSchedule>


Is there a solution for the above setup?

Thanks,
Dimitrios



UN Unknown Syncfusion Team December 6, 2019 01:04 PM UTC

Hi Dimitrios, 
 
Thanks for your patience. 
 
We are currently analyzing your query regarding “Drag and drop an appointment results in Exception” and we will update you on December 10th 2019. 
 
 
Regards, 
Niranjan Kumar 
 



UN Unknown Syncfusion Team December 10, 2019 12:18 PM UTC

Hi Dimitrios,  
  
Thanks for your patience.  

We are able to reproduce the issue “Drag and drop an appointment results in Exception” and logged it as defect. The fix will be updated in Volume 4 SP1 release which will roll out by end of January 2020. Please refer the below feedback portal. 


Regards, 
Niranjan Kumar 


Loader.
Live Chat Icon For mobile
Up arrow icon