Current Version we are using is Q2 2010 SP1 Version 2010.2.10.713. We are facing the following issue:
In grid CellEndEdit, we perform some operation on the current item of the binding source and then trying to reset it. When we use ResetBindings(), it throws the null reference (PFA) and when we use ResetCurrentItem() or ResetItem(), it throws index out of range exception (but the item which we are trying to reset is present in the binding source).
1. If we use ResetBindings() on a text box inside the child grid:
An unhandled exception occurred, and the application is terminating. For more information, see your Application event log.
- Exception Details -
Object reference not set to an instance of an object.
at Telerik.WinControls.UI.GridViewEditManager.EndEdit()
at Telerik.WinControls.UI.GridRowBehavior.ProcessEnterKey(KeyEventArgs keys)
at Telerik.WinControls.UI.GridRowBehavior.ProcessKey(KeyEventArgs keys)
at Telerik.WinControls.UI.BaseGridBehavior.ProcessKey(KeyEventArgs keys)
at Telerik.WinControls.UI.BaseGridBehavior.ProcessKeyDown(KeyEventArgs keys)
at Telerik.WinControls.UI.BaseGridEditor.OnKeyDown(KeyEventArgs keyEventArgs)
at Telerik.WinControls.UI.GridSpinEditor.OnKeyDown(KeyEventArgs e)
at Telerik.WinControls.UI.GridSpinEditor.spinElement_KeyDown(Object sender, KeyEventArgs e)
at Telerik.WinControls.RadItem.OnKeyDown(KeyEventArgs e)
at Telerik.WinControls.UI.RadSpinElement.OnKeyDown(KeyEventArgs e)
at Telerik.WinControls.UI.RadSpinElement.textItem_KeyDown(Object sender, KeyEventArgs e)
at Telerik.WinControls.RadItem.OnKeyDown(KeyEventArgs e)
at Telerik.WinControls.UI.RadTextBoxItem.TextBoxControl_KeyDown(Object sender, KeyEventArgs e)
at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
at System.Windows.Forms.TextBox.WndProc(Message& m)
at Telerik.WinControls.UI.HostedTextBoxBase.WndProc(Message& message)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
2. If we use ResetCurrentItem() or ResetItem() instead on the same text box field in the child grid:
An unhandled exception occurred, and the application is terminating. For more information, see your Application event log.
- Exception Details -
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Telerik.WinControls.Data.RadCollectionView`1.get_Item(Int32 index)
at Telerik.WinControls.Data.RadCollectionView`1.Find(Int32 itemIndex, Object dataBoundItem)
at Telerik.WinControls.Data.RadDataView`1.Find(Int32 itemIndex, Object dataBoundItem)
at Telerik.WinControls.Data.RadListSource`1.ChangeItem(Int32 index, TDataItem item)
at Telerik.WinControls.Data.RadListSource`1.currencyManager_ListChanged(Object sender, ListChangedEventArgs e)
at System.Windows.Forms.CurrencyManager.OnListChanged(ListChangedEventArgs e)
at System.Windows.Forms.CurrencyManager.List_ListChanged(Object sender, ListChangedEventArgs e)
at System.Windows.Forms.BindingSource.OnListChanged(ListChangedEventArgs e)
at System.Windows.Forms.BindingSource.ResetCurrentItem()
at Lbg.PlanNet.Client.BusinessModules.PersonalAdviceProcess.UI.AllocateAssetsToMultipleAimsView.allocatedValueElement_ValueChanged(Object sender, EventArgs e) in c:\Sasi\CurrentLatest\Client\SmartClient\BusinessModules\BusinessModules.PersonalAdviceProcess.UI\Views\AllocateAssetsToMultipleAimsView\AllocateAssetsToMultipleAimsView.cs:line 439
at System.EventHandler.Invoke(Object sender, EventArgs e)
at Telerik.WinControls.UI.RadSpinElement.OnValueChanged(EventArgs e)
at Telerik.WinControls.UI.GridSpinEditorElement.SetSpinValue(Decimal value, Boolean fromValue)
at Telerik.WinControls.UI.RadSpinElement.EndTextEdit()
at Telerik.WinControls.UI.RadSpinElement.Validate()
at Telerik.WinControls.UI.GridSpinEditor.OnKeyDown(KeyEventArgs e)
at Telerik.WinControls.UI.GridSpinEditor.spinElement_KeyDown(Object sender, KeyEventArgs e)
at Telerik.WinControls.RadItem.OnKeyDown(KeyEventArgs e)
at Telerik.WinControls.UI.RadSpinElement.OnKeyDown(KeyEventArgs e)
at Telerik.WinControls.UI.RadSpinElement.textItem_KeyDown(Object sender, KeyEventArgs e)
at Telerik.WinControls.RadItem.OnKeyDown(KeyEventArgs e)
at Telerik.WinControls.UI.RadTextBoxItem.TextBoxControl_KeyDown(Object sender, KeyEventArgs e)
at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
at System.Windows.Forms.TextBox.WndProc(Message& m)
at Telerik.WinControls.UI.HostedTextBoxBase.WndProc(Message& message)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Kindly advise if there is any way to avoid this error?.