RadGridView throws NullException when edit mode is entered

5 posts, 0 answers
  1. Metin
    Metin avatar
    15 posts
    Member since:
    May 2013

    Posted 23 Jul 2013 Link to this post

    1) edit a cell with clicking on it
    2) press esc to cancel cell edit
    3) press esc to cancel row edit
    4) click or press F2 on the same cell to edit again and the following exception is thrown

    Error Message: Object reference not set to an instance of an object.

    StackTrace is as below:

       konum Telerik.Windows.Controls.GridView.GridViewCell.CanCommitEdit()
       konum Telerik.Windows.Controls.GridView.GridViewDataControl.CommitCellEdit(GridViewCell currentCell, Boolean isLeavingRow)
       konum Telerik.Windows.Controls.GridView.GridViewDataControl.OnCurrentCellInfoChanging(GridViewCellInfo oldCell, GridViewCellInfo newCell)
       konum Telerik.Windows.Controls.GridView.GridViewDataControl.set_CurrentCellInfo(GridViewCellInfo value)
       konum Telerik.Windows.Controls.GridView.GridViewDataControl.OnCurrentItemChanged()
       konum Telerik.Windows.Controls.DataControl.CurrentItemChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       konum Telerik.Windows.PropertyMetadata.PropertyChangeHook.OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       konum System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
       konum System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
       konum System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isBindingInStyleSetter)
       konum System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       konum Telerik.Windows.Controls.DataControl.set_CurrentItem(Object value)
       konum Telerik.Windows.Controls.DataControl.Telerik.Windows.Data.Selection.ISelectorInternal.set_CurrentItem(Object value)
       konum Telerik.Windows.Data.Selection.ItemSelectionHandler.SynchronizePublicCurrentItem()
       konum Telerik.Windows.Data.Selection.ItemSelectionHandler.HandleCurrentItemChanged()
       konum Telerik.Windows.Controls.GridView.Selection.CompositeSelectionHandler.Items_CurrentChanged(Object sender, EventArgs e)
       konum Telerik.Windows.Data.DataItemCollection.OnCurrentChanged(EventArgs e)
       konum Telerik.Windows.Data.DataItemCollection.OnCollectionViewCurrentChanged(Object sender, EventArgs args)
       konum Telerik.Windows.Data.Listener`2.ReceiveWeakEvent(Object sender, TArgs args)
       konum Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
       konum Telerik.Windows.Data.QueryableCollectionView.OnCurrentChanged(EventArgs args)
       konum Telerik.Windows.Data.QueryableCollectionView.MoveCurrentToPositionCore(Int32 position)
       konum Telerik.Windows.Data.QueryableCollectionView.MoveCurrentToPosition(Int32 position)
       konum Telerik.Windows.Data.DataItemCollection.MoveCurrentToPosition(Int32 position)
       konum Telerik.Windows.Data.Selection.ItemSelectionHandler.SyncCurrentWithSelected()
       konum Telerik.Windows.Data.Selection.ItemSelectionHandler.TrySyncCurrentWithSelected()
       konum Telerik.Windows.Data.Selection.ItemSelectionHandler.RaiseSelectionChangedAndSyncCurrentWithSelectedIfNeeded(ItemSelectionChange selectionChange)
       konum Telerik.Windows.Data.Selection.ItemSelectionHandler.EndAllowedSelection(ItemSelectionChange selectionChange)
       konum Telerik.Windows.Data.Selection.ItemSelectionHandler.EndPendingSelection(ItemSelectionChange pendingSelection)
       konum Telerik.Windows.Data.Selection.ItemSelectionHandler.EndSelection()
       konum Telerik.Windows.Data.Selection.ItemSelectionHandler.HandleItemsRemoved(IEnumerable removedItems)
       konum Telerik.Windows.Data.Selection.ItemSelectionHandler.HandleItemsChanged(NotifyCollectionChangedEventArgs itemsChangedArguments)
       konum Telerik.Windows.Controls.GridView.Selection.CompositeSelectionHandler.Items_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
       konum System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       konum Telerik.Windows.Data.DataItemCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
       konum Telerik.Windows.Data.DataItemCollection.OnCollectionViewCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
       konum Telerik.Windows.Data.Listener`2.ReceiveWeakEvent(Object sender, TArgs args)
       konum Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
       konum Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
       konum Telerik.Windows.Data.QueryableCollectionView.ProcessSynchronousCollectionChangedWithAdjustedArgs(NotifyCollectionChangedEventArgs originalArguments, Int32 adjustedOldIndex, Int32 adjustedNewIndex)
       konum Telerik.Windows.Data.QueryableCollectionView.ProcessSynchronousCollectionChanged(NotifyCollectionChangedEventArgs args)
       konum Telerik.Windows.Data.QueryableCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args)
       konum Telerik.Windows.Data.QueryableCollectionView.OnSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       konum Telerik.Windows.Data.QueryableCollectionView.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args)
       konum Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
       konum System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       konum System.Windows.Data.PagedCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
       konum System.Windows.Data.PagedCollectionView.CommitEdit()
       konum System.Windows.Data.PagedCollectionView.EditItem(Object item)
       konum Telerik.Windows.Data.DataItemCollection.EditItem(Object item)
       konum Telerik.Windows.Controls.GridView.GridViewDataControl.set_RowInEditMode(GridViewRow value)
       konum Telerik.Windows.Controls.GridView.GridViewRow.IsInEditModeChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
       konum Telerik.Windows.PropertyMetadata.PropertyChangeHook.OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       konum System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
       konum System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
       konum System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isBindingInStyleSetter)
       konum System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       konum Telerik.Windows.Controls.GridView.GridViewRow.set_IsInEditMode(Boolean value)
       konum Telerik.Windows.Controls.GridView.GridViewDataControl.OnCellEditModeChanged(GridViewCell cell, Boolean newIsInEditMode)
       konum Telerik.Windows.Controls.GridView.GridViewCell.IsInEditModeChanged(DependencyObject target, DependencyPropertyChangedEventArgs e)
       konum System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
       konum System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
       konum System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isBindingInStyleSetter)
       konum System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       konum Telerik.Windows.Controls.GridView.GridViewCell.set_IsInEditMode(Boolean value)
       konum Telerik.Windows.Controls.GridView.GridViewDataControl.SwitchCellToEditMode(GridViewCell cell)
       konum Telerik.Windows.Controls.GridView.GridViewDataControl.BeginEdit(GridViewCell gridViewCell, RoutedEventArgs editEventArgs)
       konum Telerik.Windows.Controls.GridView.GridViewDataControl.OnCellMouseDown(GridViewCell cell, MouseButtonEventArgs args)
       konum Telerik.Windows.Controls.GridView.GridViewCell.OnMouseLeftButtonDown(MouseButtonEventArgs e)
       konum System.Windows.Controls.Control.OnMouseLeftButtonDown(Control ctrl, EventArgs e)
       konum MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 23 Jul 2013 Link to this post

    Hello,

    We have fixed such an issue before Q1 2013 release, so may I ask you to test with the latest version and confirm if you still get the problem? 
     

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. Metin
    Metin avatar
    15 posts
    Member since:
    May 2013

    Posted 23 Jul 2013 Link to this post

    Hi Didie,

    I am using Q2 2013 (2013.2.611.1050 [Jun.11.2013]). And after installing and referencing the new dlls with telerik upgrade tool in visual studio that error has started to raise.

    Can you guys check that issue again? Is it possible.

    If you enter "enter mode" in another row and go back to the first row you have cancelled the edit the error does not occur.
    Seems like something has been forgotten.
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 23 Jul 2013 Link to this post

    Hi,

    I am not able to reproduce such an exception on any of our online examples. I have also created a test project, but there is not such an issue on my side.

    Would you please check the test project and try to modify it to illustrate the null reference exception?

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  5. Metin
    Metin avatar
    15 posts
    Member since:
    May 2013

    Posted 23 Jul 2013 Link to this post

    I am not able to recreate over your solution too. There are so much work to create a similar workaround.
    Cancel edit also corrupts raddatapager's page size, not size but the behaviour of it, in second listing from a datasource
    it shows only one page.
    I am using pagedcollectionview for my grid and pager and dataform in my custom user control.

    And finally i have found the problem in my custom user control 
    i have an itemssource dependency property of type pagedcollectionview.
    i had several issues before because of using pagedcollectionview but i could fix them,
    but now simply changed it to IList to continue supporting operations add, remove etc.

    now pager dataform and grid works great. The null exception also has gone away. 

    And note for everyone try not to use pagedcollectionview, maybe i am bad with it or telerik or microsoft :)

    Thank you very much for your Help.
Back to Top