telerik/xaml-sdk

SqlResourceType is Null on SqlResource

drkhodakarami opened this issue · 2 comments

Using the code first approach for scheduler view project :

I Updated the data base using the code first project, then, manually added two resource types and few resources related to them in ResourceType and Resource tables in sqlserver manager. How ever, when I try to run the application, I get null pointer exception on the SqlResourceType in the SqlResource class in line 16 ==>

get { return this.SqlResourceType.Name; } set { if (this.SqlResourceType.Name != value) <================= line 16 !!!! { this.SqlResourceType.Name = value; this.OnPropertyChanged("ResourceType"); } }

another issue with the same project, after the above failure, I tried to add resource types and resources in xml, so far good. But when I add grouping, and now I try to add a new appointment under a group, I get an error, here is the xml code:

<telerik:RadScheduleView.ResourceTypesSource> <telerik:ResourceTypeCollection> <telerik:ResourceType Name ="Service" DisplayName="Service" Brush="Coral" AllowMultipleSelection="True"> <telerik:Resource ResourceName="SkinCare" DisplayName="SkinCare" ResourceType="Service"/> <telerik:Resource ResourceName="Injection" DisplayName="Injection" ResourceType="Service"/> <telerik:Resource ResourceName="Visit" DisplayName="Visit" ResourceType="Service"/> </telerik:ResourceType> </telerik:ResourceTypeCollection> </telerik:RadScheduleView.ResourceTypesSource> <telerik:RadScheduleView.GroupDescriptionsSource> <telerik:GroupDescriptionCollection> <telerik:ResourceGroupDescription ResourceType="Service" ShowNullGroup="True"/> </telerik:GroupDescriptionCollection> </telerik:RadScheduleView.GroupDescriptionsSource>

and here is the error I get :
System.ArgumentException: 'The value "Injection" is not of type "DatabaseEntityFramework.SqlResource" and cannot be used in this generic collection. Parameter name: value'

and finally the call stack :
> mscorlib.dll!System.ThrowHelper.ThrowWrongValueTypeArgumentException(object value, System.Type targetType) Unknown mscorlib.dll!System.Collections.Generic.List<DatabaseEntityFramework.SqlResource>.System.Collections.IList.Add(object item) Unknown Telerik.Windows.Controls.ScheduleView.dll!Telerik.Windows.Controls.CollectionExtensions.AddRange(System.Collections.IList list, System.Collections.IEnumerable items) Unknown Telerik.Windows.Controls.ScheduleView.dll!Telerik.Windows.Controls.ScheduleViewBase.CopyAppointmentDataFromSlot(Telerik.Windows.Controls.ScheduleView.IAppointment appointment, Telerik.Windows.Controls.ScheduleView.Slot slot) Unknown Telerik.Windows.Controls.ScheduleView.dll!Telerik.Windows.Controls.ScheduleViewBase.CreateNew(Telerik.Windows.Controls.ScheduleView.Slot slot) Unknown Telerik.Windows.Controls.ScheduleView.dll!Telerik.Windows.Controls.ScheduleViewBase.CreateAppointmentWithDialog(object parameter) Unknown Telerik.Windows.Controls.ScheduleView.dll!Telerik.Windows.Controls.ScheduleViewBase.OnCreateAppointmentExecuted(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) Unknown PresentationCore.dll!System.Windows.Input.CommandBinding.OnExecuted(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) Unknown PresentationCore.dll!System.Windows.Input.CommandManager.ExecuteCommandBinding(object sender, System.Windows.Input.ExecutedRoutedEventArgs e, System.Windows.Input.CommandBinding commandBinding) Unknown PresentationCore.dll!System.Windows.Input.CommandManager.FindCommandBinding(object sender, System.Windows.RoutedEventArgs e, System.Windows.Input.ICommand command, bool execute) Unknown PresentationCore.dll!System.Windows.Input.CommandManager.OnExecuted(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) Unknown PresentationCore.dll!System.Windows.UIElement.OnExecutedThunk(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) Unknown PresentationCore.dll!System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(System.Delegate genericHandler, object target) Unknown PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) Unknown PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) Unknown PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) Unknown PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) Unknown PresentationCore.dll!System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs args) Unknown PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs args, bool trusted) Unknown PresentationCore.dll!System.Windows.Input.RoutedCommand.ExecuteImpl(object parameter, System.Windows.IInputElement target, bool userInitiated) Unknown PresentationCore.dll!System.Windows.Input.RoutedCommand.ExecuteCore(object parameter, System.Windows.IInputElement target, bool userInitiated) Unknown PresentationCore.dll!System.Windows.Input.CommandManager.TranslateInput(System.Windows.IInputElement targetElement, System.Windows.Input.InputEventArgs inputEventArgs) Unknown PresentationCore.dll!System.Windows.UIElement.OnMouseDownThunk(object sender, System.Windows.Input.MouseButtonEventArgs e) Unknown PresentationCore.dll!System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) Unknown PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) Unknown PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) Unknown PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) Unknown PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) Unknown PresentationCore.dll!System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs args) Unknown PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs args, bool trusted) Unknown PresentationCore.dll!System.Windows.Input.InputManager.ProcessStagingArea() Unknown PresentationCore.dll!System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs input) Unknown PresentationCore.dll!System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport inputReport) Unknown PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.ReportInput(System.IntPtr hwnd, System.Windows.Input.InputMode mode, int timestamp, System.Windows.Input.RawMouseActions actions, int x, int y, int wheel) Unknown PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.FilterMessage(System.IntPtr hwnd, MS.Internal.Interop.WindowMessage msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown PresentationCore.dll!System.Windows.Interop.HwndSource.InputFilterMessage(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) Unknown WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Unknown WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Unknown WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs) Unknown WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) Unknown [Native to Managed Transition] [Managed to Native Transition] WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) Unknown WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame frame) Unknown PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore) Unknown PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window) Unknown PresentationFramework.dll!System.Windows.Application.Run(System.Windows.Window window) Unknown PresentationFramework.dll!System.Windows.Application.Run() Unknown MedicalOffice.exe!MedicalOffice.App.Main() Unknown