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

Error/break in latest releases? Object reference not set to an instance of an object-error

5 Answers 51 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Clas Ericson
Top achievements
Rank 2
Clas Ericson asked on 09 Oct 2012, 07:26 AM
Hi,
I'm having trouble with RadGridView when leaving edit mode in a cell. It began when I updated Telerik components to version 2012.2.0725.1040 for SL4 from 2012.1.326.1040. The error message was as follows:
Object reference not set to an instance of an object.
 
   vid Telerik.Windows.Controls.GridViewBoundColumnBase.GetValidationErrors(Object dataItem, String propertyName)
   vid Telerik.Windows.Controls.GridView.GridViewCell.<GetDataErrors>d__7.MoveNext()
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.ValidateCell(GridViewCell cell)
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.PerformCellValidation(GridViewCell cell)
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.CommitCellEdit(GridViewCell currentCell, Boolean isLeavingRow)
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.CommitEdit()
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.OnCommitEditCommand(Object sender, ExecutedRoutedEventArgs e)
   vid Telerik.Windows.Controls.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   vid Telerik.Windows.Controls.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
   vid Telerik.Windows.Controls.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   vid Telerik.Windows.Controls.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   vid Telerik.Windows.Controls.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   vid Telerik.Windows.Controls.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
   vid Telerik.Windows.RadRoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   vid Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs)
   vid Telerik.Windows.RouteItem.InvokeHandler(RadRoutedEventArgs routedEventArgs)
   vid Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain)
   vid Telerik.Windows.EventRoute.InvokeHandlers(Object source, RadRoutedEventArgs args)
   vid Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args)
   vid Telerik.Windows.DependencyObjectExtensions.RaiseEvent(DependencyObject element, RadRoutedEventArgs e)
   vid Telerik.Windows.Controls.RoutedCommand.ExecuteImpl(Object parameter, UIElement target)
   vid Telerik.Windows.Controls.RoutedCommand.Execute(Object parameter, UIElement target)
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.ExecutePendingCommand()
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.PendAndExecuteCommands(KeyEventArgs e)
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.OnKeyDown(KeyEventArgs e)
   vid System.Windows.Controls.Control.OnKeyDown(Control ctrl, EventArgs e)
   vid MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

When updating to 2012.2.0912.1040 and later also 2012.2.1001.DEV.hotfix I get the "same" error but with another call stack. The error message now is as follows.
Object reference not set to an instance of an object.
 
   vid Telerik.Windows.Controls.StyleManager.GetTheme(DependencyObject element)
   vid Telerik.Windows.Controls.GridView.GridViewCell.get_EditorPresenter()
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.ValidateCell(GridViewCell cell)
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.PerformCellValidation(GridViewCell cell)
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.CommitCellEdit(GridViewCell currentCell, Boolean isLeavingRow)
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.CommitEdit()
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.OnCommitEditCommand(Object sender, ExecutedRoutedEventArgs e)
   vid Telerik.Windows.Controls.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   vid Telerik.Windows.Controls.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
   vid Telerik.Windows.Controls.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   vid Telerik.Windows.Controls.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   vid Telerik.Windows.Controls.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   vid Telerik.Windows.Controls.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
   vid Telerik.Windows.RadRoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   vid Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs)
   vid Telerik.Windows.RouteItem.InvokeHandler(RadRoutedEventArgs routedEventArgs)
   vid Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain)
   vid Telerik.Windows.EventRoute.InvokeHandlers(Object source, RadRoutedEventArgs args)
   vid Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args)
   vid Telerik.Windows.DependencyObjectExtensions.RaiseEvent(DependencyObject element, RadRoutedEventArgs e)
   vid Telerik.Windows.Controls.RoutedCommand.ExecuteImpl(Object parameter, UIElement target)
   vid Telerik.Windows.Controls.RoutedCommand.Execute(Object parameter, UIElement target)
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.ExecutePendingCommand()
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.PendAndExecuteCommands(KeyEventArgs e)
   vid Telerik.Windows.Controls.GridView.GridViewDataControl.OnKeyDown(KeyEventArgs e)
   vid System.Windows.Controls.Control.OnKeyDown(Control ctrl, EventArgs e)
   vid MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)

Any idea of what has been changed in these builds? The release notes only said "Validation improvement to support better various validation scenarios." in the release notes for 2012.1.607.

Kind Regards,
Clas Ericson

5 Answers, 1 is accepted

Sort by
0
Clas Ericson
Top achievements
Rank 2
answered on 09 Oct 2012, 12:46 PM
Hello again,
if it helps I've just found out that the error occurs only in one of my two editable columns. One column allows setting a date and that column works just fine. The other column allows the user to edit numeric value and that's where the error occurs.

I've tried with both the following editing scenarios:
  1. Letting the GridView itself create the textbox when in edit mode
    No success, error occurs.
  2. Manually set the celledittemplate to either a standard textbox or RadWatermarkTextBox
    No success, error occurs.
  3. Manually set the celledittemplate to RadNumericUpDown
    Success, no error occurs. Unfortunately that control is not an alternative in my case.

In all three scenarios above, the validation of the cell seems to work fine.


Regards, Clas Ericson
0
Clas Ericson
Top achievements
Rank 2
answered on 10 Oct 2012, 11:42 AM
Update on the problem
I'm rolling back to version 2012.1.326.1040 since that version works without errors. But what has been changed in the later releases?!?! Until I know what has been changed, I'll be more than afraid of doing any future update of Teleriks components.
0
Vera
Telerik team
answered on 10 Oct 2012, 01:35 PM
Hello Clas Ericson,

 
We tried to reproduce the reported exception but to no avail. Will it be possible to send a simple runnable project demonstrating the issue? We will debug it on our side in order to find the cause. Please take a look at this blog post for a reference on how to isolate a problem in a sample project.

Thank you in advance.

Kind regards,
Vera
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Clas Ericson
Top achievements
Rank 2
answered on 11 Oct 2012, 08:31 AM
Hello Vera,
thanks for your efforts! I'm trying to create an isolated example and has been doing so since my first post. Uunfortunately I haven't yet been able to produce the error in my sample. Therefor I keep adding stuff to the example from my real application until I manage to produce the error. When I have, I'll post a link to the example.

Regards, Clas Ericson
0
pierre-jean
Top achievements
Rank 1
Veteran
Iron
answered on 11 Oct 2012, 12:18 PM
Hello
just a quick word to inform you that I have the same error message, it happened after I added a LabelElement and thereafter my forms design gets badly corrupted, a panel is moved outside of the form.
I will try to get a better understnding of the problem and let you know what  I find
thanks
Pierre-Jean
Tags
GridView
Asked by
Clas Ericson
Top achievements
Rank 2
Answers by
Clas Ericson
Top achievements
Rank 2
Vera
Telerik team
pierre-jean
Top achievements
Rank 1
Veteran
Iron
Share this question
or