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

Exception on PersistanceManager.Save

5 Answers 157 Views
PersistenceFramework
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 1
Stefan asked on 06 Nov 2012, 06:07 PM
Hello,

Because of broken Drag on Drop on GridView, I used now latest internal Build 1106.
I cant serialize my GridView now (Build 1029 works fine).

Object reference not set to an instance of an object

   at Telerik.Windows.Persistence.Serialization.Serializer.Serialize(Object obj) in c:\TB\117\WPF_Scrum\Current_HotFix\Sources\Frameworks\Persistence\Serialization\Serializer.cs:line 77
   at Telerik.Windows.Persistence.PersistenceManager.Save(Object obj) in c:\TB\117\WPF_Scrum\Current_HotFix\Sources\Frameworks\Persistence\PersistenceManager.cs:line 91
   at FileExplorer.View.ExplorerWindow.SaveState() in D:\Y\IZTMediaContainer\IZTMediaLibrary\View\ExplorerWindow.xaml.cs:line 105
   at IZTMediaLibrary.View.MainWindow.RadWindow_Closed(Object sender, WindowClosedEventArgs e) in D:\Y\IZTMediaContainer\IZTMediaLibrary\View\MainWindow.xaml.cs:line 83
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Telerik.Windows.Controls.RadWindow.OnClosed(WindowClosedEventArgs args) in c:\TB\117\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\Window\RadWindow.cs:line 552
   at Telerik.Windows.Controls.RadWindow.OnClosed() in c:\TB\117\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\Window\RadWindow.cs:line 677
   at Telerik.Windows.Controls.WindowBase.TryClose(Boolean shouldCloseHost) in c:\TB\117\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\Window\WindowBase.cs:line 715
   at Telerik.Windows.Controls.WindowBase.TryClose() in c:\TB\117\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\Window\WindowBase.cs:line 702
   at Telerik.Windows.Controls.WindowBase.Close() in c:\TB\117\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\Window\WindowBase.cs:line 564
   at Telerik.Windows.Controls.WindowBase.<.cctor>b__0(WindowBase w) in c:\TB\117\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\Window\WindowBase.cs:line 205
   at Telerik.Windows.Controls.CommandsHelper.TryCast[T](Object value, Action`1 action) in c:\TB\117\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\Window\CommandsHelper.cs:line 60
   at Telerik.Windows.Controls.CommandsHelper.<>c__DisplayClass5`1.<RegisterClassHandler>b__3(Object s, ExecutedRoutedEventArgs e) in c:\TB\117\WPF_Scrum\Current_HotFix\Sources\Controls\Navigation\Window\CommandsHelper.cs:line 16
   at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
   at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
   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.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
   at System.Windows.Input.RoutedCommand.ExecuteCore(Object parameter, IInputElement target, Boolean userInitiated)
   at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at Telerik.Windows.Controls.RadButton.OnClick() in c:\TB\117\WPF_Scrum\Current_HotFix\Sources\Core\Controls\Buttons\RadButton.cs:line 389
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.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.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.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 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

5 Answers, 1 is accepted

Sort by
0
Stefan
Top achievements
Rank 1
answered on 06 Nov 2012, 06:48 PM
you example application is not working too
http://ysoft.de/373452_HierarchicalGridViewSerialization.zip
0
PW
Top achievements
Rank 1
answered on 07 Nov 2012, 03:47 PM
We, too, are experiencing the same problem with the latest internal build.  We had to move onto this build because the latest release had a crash involving the re-ordrering of radgridview columns via drag/drop.

Currently we are blocked.  The second line (below) crashes with a null reference exception:

PersistenceManager manager = new PersistenceManager(); 

 

Stream str = manager.Save(this.radGridView1);

This occurs when we attempt to persist column settings for the RadGridView (exactly the way you demonstrate it in your samples).

Help!


0
Tina Stancheva
Telerik team
answered on 08 Nov 2012, 12:26 PM
Hi guys,

Thank you for reporting this issue. We managed to isolate its cause in the GridViewLength type - the type of the columns Width. However we'll need more time to further investigate it and look for solutions.

In the meantime you can workaround the issue by introducing a new class - for example ColumnWidth, to hold the settings of the GridViewLength type. This means that in the GridViewCustomPropertyProvider implementation, instead of saving the Columns Width, you'll save the Columns Width DesiredValue, DisplayValue, UnitType and Value properties.

I modified the HierarchicalGridViewSerializaiton sample to demonstrate this approach - all modifications are implemented in the way the RadGridView.Columns.Width property is persisted. Please give it a try and let me know if it helps.

Kind regards,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Jeff
Top achievements
Rank 1
answered on 19 Dec 2012, 06:53 PM
Is there an item in PITS that we could track to know whether this issue gets fixed in an upcoming build?
0
Tina Stancheva
Telerik team
answered on 21 Dec 2012, 03:49 PM
Hello Jeff,

This issue is already fixed and you can test your application with the Q3 2012 SP release. Let us know if you encounter any issues with it.

Greetings,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
PersistenceFramework
Asked by
Stefan
Top achievements
Rank 1
Answers by
Stefan
Top achievements
Rank 1
PW
Top achievements
Rank 1
Tina Stancheva
Telerik team
Jeff
Top achievements
Rank 1
Share this question
or