I have created a RadScheduler / RadSchedulerNavigator on a form. On the Form_Load Event I create a DataTable from a SQL database, add the DataTable to a DataSet and then map the values to my database.
Dim AppointmentDT As DataTable = SQLRowToDt(connStr, "Select * From AppointmentTable")
' Appointment Dataset
Dim AppointmentDataSet As DataSet = New DataSet()
Dim AppointmentDTCopy As DataTable = AppointmentDT.Copy
AppointmentDTCopy.TableName = "AppointmentDT"
AppointmentDataSet.Tables.Add(AppointmentDTCopy)
' Appointment Mappings
Dim appointmentMappingInfo As New AppointmentMappingInfo()
appointmentMappingInfo.Start = "StartTime"
appointmentMappingInfo.End = "EndTime"
appointmentMappingInfo.Summary = "Subject"
appointmentMappingInfo.Description = "Description"
appointmentMappingInfo.Location = "Location"
appointmentMappingInfo.BackgroundId = "Background"
appointmentMappingInfo.StatusId = "StatusID"
appointmentMappingInfo.RecurrenceRule = "RecurrenceRule"
SchedulerBindingDataSource1.EventProvider.Mapping = appointmentMappingInfo
SchedulerBindingDataSource1.EventProvider.DataSource = AppointmentDataSet.Tables("AppointmentDT")
RadScheduler1.DataSource = SchedulerBindingDataSource1
I can add / edit / delete / save back to the database the series just fine. However if I attempt to edit or delete a single occurrence I get a NullReferenceException.
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="Telerik.WinControls.Scheduler"
StackTrace:
at Telerik.WinControls.UI.Scheduler.BindingProviderBase`1.FindDataSourceProperty(SchedulerMapping mapping)
at Telerik.WinControls.UI.SchedulerBindingDataSource.EventBindingProvider.GetExceptionList(Object dataItem)
at Telerik.WinControls.UI.SchedulerBindingDataSource.EventBindingProvider.InsertCore(IEvent itemToInsert)
at Telerik.WinControls.UI.Scheduler.BindingProviderBase`1.Insert(T itemToInsert)
at Telerik.WinControls.UI.RadScheduler.OnAddAppointments(IList list)
at Telerik.WinControls.UI.RadScheduler.appointments_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.Data.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.Data.ObservableCollection`1.NotifyListenersCollectionChanged(NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.UI.SchedulerAppointmentCollection.OnExceptionsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.Data.ObservableCollection`1.NotifyListenersCollectionChanged(NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedAction action, Object item, Int32 index)
at Telerik.WinControls.Data.ObservableCollection`1.InsertItem(Int32 index, T item, Action`1 approvedAction)
at Telerik.WinControls.Data.ObservableCollection`1.InsertItem(Int32 index, T item)
at Telerik.WinControls.UI.SchedulerAppointmentCollection.InsertItem(Int32 index, IEvent item)
at System.Collections.ObjectModel.Collection`1.Add(T item)
at Telerik.WinControls.UI.SchedulerUIHelper.DeleteAppointment(IEvent appointment, RadScheduler scheduler)
at Telerik.WinControls.UI.Scheduler.Dialogs.EditAppointmentDialog.OnDeleteButtonClicked()
at System.Windows.Forms.Control.OnClick(EventArgs e)
at Telerik.WinControls.RadControl.OnClick(EventArgs e)
at Telerik.WinControls.UI.RadButtonBase.buttonElement_Click(Object sender, EventArgs e)
at Telerik.WinControls.RadItem.OnClick(EventArgs e)
at Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e)
at Telerik.WinControls.RadItem.DoClick(EventArgs e)
at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at Telerik.WinControls.UI.Scheduler.Dialogs.EditAppointmentDialog.Telerik.WinControls.UI.Scheduler.Dialogs.IEditAppointmentDialog.ShowDialog()
at Telerik.WinControls.UI.RadScheduler.ShowAppointmentEditDialog(IEvent appointment, Boolean recurringAppointment)
at Telerik.WinControls.UI.RadScheduler.editAppointment_Click(Object sender, EventArgs e)
at Telerik.WinControls.RadItem.OnClick(EventArgs e)
at Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e)
at Telerik.WinControls.RadItem.DoClick(EventArgs e)
at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at Telerik.WinControls.UI.RadPopupControlBase.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at MartzSchedule.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
This is my first time using RadScheduler, any help you can give me would be greatly appreciated.
Thanks
Dim AppointmentDT As DataTable = SQLRowToDt(connStr, "Select * From AppointmentTable")
' Appointment Dataset
Dim AppointmentDataSet As DataSet = New DataSet()
Dim AppointmentDTCopy As DataTable = AppointmentDT.Copy
AppointmentDTCopy.TableName = "AppointmentDT"
AppointmentDataSet.Tables.Add(AppointmentDTCopy)
' Appointment Mappings
Dim appointmentMappingInfo As New AppointmentMappingInfo()
appointmentMappingInfo.Start = "StartTime"
appointmentMappingInfo.End = "EndTime"
appointmentMappingInfo.Summary = "Subject"
appointmentMappingInfo.Description = "Description"
appointmentMappingInfo.Location = "Location"
appointmentMappingInfo.BackgroundId = "Background"
appointmentMappingInfo.StatusId = "StatusID"
appointmentMappingInfo.RecurrenceRule = "RecurrenceRule"
SchedulerBindingDataSource1.EventProvider.Mapping = appointmentMappingInfo
SchedulerBindingDataSource1.EventProvider.DataSource = AppointmentDataSet.Tables("AppointmentDT")
RadScheduler1.DataSource = SchedulerBindingDataSource1
I can add / edit / delete / save back to the database the series just fine. However if I attempt to edit or delete a single occurrence I get a NullReferenceException.
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="Telerik.WinControls.Scheduler"
StackTrace:
at Telerik.WinControls.UI.Scheduler.BindingProviderBase`1.FindDataSourceProperty(SchedulerMapping mapping)
at Telerik.WinControls.UI.SchedulerBindingDataSource.EventBindingProvider.GetExceptionList(Object dataItem)
at Telerik.WinControls.UI.SchedulerBindingDataSource.EventBindingProvider.InsertCore(IEvent itemToInsert)
at Telerik.WinControls.UI.Scheduler.BindingProviderBase`1.Insert(T itemToInsert)
at Telerik.WinControls.UI.RadScheduler.OnAddAppointments(IList list)
at Telerik.WinControls.UI.RadScheduler.appointments_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.Data.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.Data.ObservableCollection`1.NotifyListenersCollectionChanged(NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.UI.SchedulerAppointmentCollection.OnExceptionsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.Data.ObservableCollection`1.NotifyListenersCollectionChanged(NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedAction action, Object item, Int32 index)
at Telerik.WinControls.Data.ObservableCollection`1.InsertItem(Int32 index, T item, Action`1 approvedAction)
at Telerik.WinControls.Data.ObservableCollection`1.InsertItem(Int32 index, T item)
at Telerik.WinControls.UI.SchedulerAppointmentCollection.InsertItem(Int32 index, IEvent item)
at System.Collections.ObjectModel.Collection`1.Add(T item)
at Telerik.WinControls.UI.SchedulerUIHelper.DeleteAppointment(IEvent appointment, RadScheduler scheduler)
at Telerik.WinControls.UI.Scheduler.Dialogs.EditAppointmentDialog.OnDeleteButtonClicked()
at System.Windows.Forms.Control.OnClick(EventArgs e)
at Telerik.WinControls.RadControl.OnClick(EventArgs e)
at Telerik.WinControls.UI.RadButtonBase.buttonElement_Click(Object sender, EventArgs e)
at Telerik.WinControls.RadItem.OnClick(EventArgs e)
at Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e)
at Telerik.WinControls.RadItem.DoClick(EventArgs e)
at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at Telerik.WinControls.UI.Scheduler.Dialogs.EditAppointmentDialog.Telerik.WinControls.UI.Scheduler.Dialogs.IEditAppointmentDialog.ShowDialog()
at Telerik.WinControls.UI.RadScheduler.ShowAppointmentEditDialog(IEvent appointment, Boolean recurringAppointment)
at Telerik.WinControls.UI.RadScheduler.editAppointment_Click(Object sender, EventArgs e)
at Telerik.WinControls.RadItem.OnClick(EventArgs e)
at Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e)
at Telerik.WinControls.RadItem.DoClick(EventArgs e)
at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
at Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
at Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at Telerik.WinControls.RadControl.WndProc(Message& m)
at Telerik.WinControls.UI.RadPopupControlBase.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
at MartzSchedule.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
This is my first time using RadScheduler, any help you can give me would be greatly appreciated.
Thanks