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

RadScheduler for WinForms with OpenAccess for DataBinding crashes with System.NotSupportedException or doesn't save changes

2 Answers 117 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Nihat
Top achievements
Rank 1
Nihat asked on 21 Sep 2010, 03:25 PM
Hello,

i'm trying to use the RadScheduler for WinForms with OpenAccess for databinding.
When i try to make a new appointment it chrashes with the System.NotSupportedException.
I made a small basic sample app by using the RadScheduler Binding-Demo and this topics:
http://www.telerik.com/help/openaccess-orm/openaccess-tasks-howto-radscheduler-win.html
http://www.telerik.com/help/winforms/using_a_data_provider.html
See sample app: "RadScheduler OpenAccess WinForm"

Edit: i see that i can't post a sample app here, only pictures. Is it possible to give you the sample app somehow, so you can reconstruct the issue?

The StackTrace is:
System.NotSupportedException wurde nicht behandelt.
  Message=Die angegebene Methode wird nicht unterstützt.
  Source=Telerik.OpenAccess
  StackTrace:
       bei Telerik.OpenAccess.RT.Wrapper4IList.Clear()
       bei Telerik.WinControls.UI.Scheduler.SimpleResourceIdMapper.ClearResourceIds()
       bei Telerik.WinControls.UI.SchedulerBindingDataSource.EventBindingProvider.UpdateChildItems()
       bei Telerik.WinControls.UI.Scheduler.BindingProviderBase`1.Insert(T itemToInsert)
       bei Telerik.WinControls.UI.RadScheduler.OnAddAppointments(IList list)
       bei Telerik.WinControls.UI.RadScheduler.appointments_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
       bei Telerik.WinControls.Data.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       bei Telerik.WinControls.Data.ObservableCollection`1.NotifyListenersCollectionChanged(NotifyCollectionChangedEventArgs e)
       bei Telerik.WinControls.Data.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
       bei Telerik.WinControls.Data.ObservableCollection`1.InsertItem(Int32 index, T item, Action`1 approvedAction)
       bei Telerik.WinControls.UI.SchedulerAppointmentCollection.InsertItem(Int32 index, IEvent item)
       bei System.Collections.ObjectModel.Collection`1.Add(T item)
       bei Telerik.WinControls.UI.RadScheduler.AddNewAppointmentWithDialog(DateTimeInterval interval, Boolean recurringAppointment, SchedulerResourceCollection resources)
       bei Telerik.WinControls.UI.DayViewAppointmentsTable.cell_DoubleClick(Object sender, EventArgs e)
       bei Telerik.WinControls.UI.DayViewAppointmentsTable.CellDoubleClick(Object sender, EventArgs e)
       bei Telerik.WinControls.UI.RadSchedulerElement.scheduler_CellElementDoubleClick(Object sender, EventArgs e)
       bei Telerik.WinControls.UI.RadScheduler.OnCellElementDoubleClick(Object sender, EventArgs args)
       bei Telerik.WinControls.UI.SchedulerCellElement.OnDoubleClick(EventArgs e)
       bei Telerik.WinControls.RadItem.DoDoubleClick(EventArgs e)
       bei Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       bei Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
       bei Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
       bei Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
       bei Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)
       bei Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
       bei Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
       bei Telerik.WinControls.UI.RadScheduler.OnMouseUp(MouseEventArgs e)
       bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       bei System.Windows.Forms.Control.WndProc(Message& m)
       bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       bei Telerik.WinControls.RadControl.WndProc(Message& m)
       bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       bei System.Windows.Forms.Application.Run(Form mainForm)
       bei RadScheduler_OpenAccess_WinForm.Program.Main() in E:\Coding Area\_easySolution\easyTermin\RadScheduler OpenAccess WinForm\RadScheduler OpenAccess WinForm\Program.cs:Zeile 18.
       bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       bei System.Threading.ThreadHelper.ThreadStart()
  InnerException:


Kind regards
Nihat

P.S. it's an urgent issue, cause i've to make a prototype soon to decide if we will use Telerik for the comming project.

2 Answers, 1 is accepted

Sort by
0
Nihat
Top achievements
Rank 1
answered on 21 Sep 2010, 04:47 PM
i found the reason for the error.

In the "MyAppointment"-class of the RadScheduler Binding-Demo there is this code.
public List<MyResource> Resources
{
    get
    {
        if (this.resources == null)
        {
            this.resources = new List<MyResource>();
        }
 
        return this.resources;
    }
}

this part causes the error:
        if (this.resources == null)
        {
            this.resources = new List<MyResource>();
        }

Commenting this out solves the issue.

Perhaps you can tell me why?
0
Dobry Zranchev
Telerik team
answered on 24 Sep 2010, 04:00 PM
Hello Nihat Özkan,

Thank you for writing.

You could use Open Access, but not as a provider for RadScheduler for WinForms. For this case you have to take the business object from the Open Access object and map it to the RadScheduler for WinForms. You could read the available documentation concerning the topic of Binding to Business Object and the articles that you have found concerning the Open Access usage. I hope that this will help you.

Feel free to contact us in case you have further questions.

Kind regards,
Dobry Zranchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Scheduler and Reminder
Asked by
Nihat
Top achievements
Rank 1
Answers by
Nihat
Top achievements
Rank 1
Dobry Zranchev
Telerik team
Share this question
or