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

System.NullReferenceException when pressing Tab key

8 Answers 159 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mauricio
Top achievements
Rank 1
Mauricio asked on 29 Mar 2010, 10:04 PM
Hello
GridView is raising an exception when the grid has focus and I press Tab key. This exception is raised either within an empty grid or within a filled grid.

The exception: System.NullReferenceException
The Stack Trace:
  StackTrace "   en Telerik.Windows.Controls.GridView.GridViewDataControl.Move(FocusNavigationDirection navigationDirection)\r\n   en Telerik.Windows.Controls.GridView.GridViewDataControl.ExecuteMoveCommands(FocusNavigationDirection direction)\r\n   en Telerik.Windows.Controls.GridView.GridViewDataControl.MoveNext()\r\n   en Telerik.Windows.Controls.GridView.GridViewDataControl.OnMoveNextCommand(Object sender, ExecutedRoutedEventArgs e)\r\n   en Telerik.Windows.Controls.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)\r\n   en Telerik.Windows.Controls.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)\r\n   en Telerik.Windows.Controls.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)\r\n   en Telerik.Windows.Controls.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)\r\n   en Telerik.Windows.Controls.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)\r\n   en Telerik.Windows.Controls.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)\r\n   en Telerik.Windows.RadRoutedEventArgs.InvokeHandler(Delegate handler, Object target)\r\n   en Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs)\r\n   en Telerik.Windows.RouteItem.InvokeHandler(RadRoutedEventArgs routedEventArgs)\r\n   en Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain)\r\n   en Telerik.Windows.EventRoute.InvokeHandlers(Object source, RadRoutedEventArgs args)\r\n   en Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args)\r\n   en Telerik.Windows.DependencyObjectExtensions.RaiseEvent(DependencyObject element, RadRoutedEventArgs e)\r\n   en Telerik.Windows.Controls.RoutedCommand.ExecuteImpl(Object parameter, UIElement target)\r\n   en Telerik.Windows.Controls.RoutedCommand.Execute(Object parameter, UIElement target)\r\n   en Telerik.Windows.Controls.RoutedCommand.System.Windows.Input.ICommand.Execute(Object parameter)\r\n   en Telerik.Windows.Controls.GridView.GridViewDataControl.OnKeyDown(KeyEventArgs e)\r\n   en System.Windows.Controls.Control.OnKeyDown(Control ctrl, EventArgs e)\r\n   en MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)" string

Any help will be welcomed.
Mauricio Magni.

8 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 01 Apr 2010, 04:37 PM
Hello Mauricio,

Please try this with our latest internal build, since this issue is already fixed.
Sorry for the inconvenience caused.

Regards,
Nedyalko Nikolov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Mauricio
Top achievements
Rank 1
answered on 02 Apr 2010, 02:39 PM
Hello Nedyalko

Latest build fixed the problem.

Thank you!
Mauricio Magni
0
aviv ron
Top achievements
Rank 1
answered on 21 Apr 2010, 12:51 PM
when is it going to be released? i have an application in 3rd cycle QA suffering from this problem.
i dont suppose using an internal build in the released application would be a good idea, right?
0
Vlad
Telerik team
answered on 21 Apr 2010, 01:13 PM
Hi,

The official service pack will be most probably later today.

Greetings,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
aviv ron
Top achievements
Rank 1
answered on 25 Apr 2010, 01:20 AM
Thanks. the service pack fixed this bug.
0
Ramon de Klein
Top achievements
Rank 1
answered on 09 Jun 2010, 02:11 PM
Where can I get this service pack for the WPF rad controls? I experience the same issue, but cannot find it. I investigated the code with Reflector and it seems to fail only when using FocusNavigationDirection.Next or FocusNavigationDirection.Previous.

private bool Move(FocusNavigationDirection navigationDirection) 
    GridViewCell nextCell = null
    switch (navigationDirection) 
    { 
        case FocusNavigationDirection.Next: 
        case FocusNavigationDirection.Previous: 
            if (!this.CurrentCell.IsInEditMode)      // BUG: No check for this.CurrentCell != null :-( 
            { 
                nextCell = this.FindNextVisibleCell(navigationDirection); 
                break
            } 
            nextCell = this.FindNextEditableCell(navigationDirection); 
            break
 
        case FocusNavigationDirection.Left: 
        case FocusNavigationDirection.Right: 
        case FocusNavigationDirection.Up: 
        case FocusNavigationDirection.Down: 
            nextCell = this.OnArrowKeyDown(this.CurrentCell, navigationDirection); 
            if ((this.CurrentCell != null) && this.CurrentCell.IsInEditMode)  // Check is here
            { 
                while ((nextCell != null) && !nextCell.Column.CanEdit()) 
                { 
                    nextCell = this.OnArrowKeyDown(nextCell, navigationDirection); 
                } 
            } 
            break
    } 
    if (nextCell != null
    { 
        nextCell.IsCurrent = true
        if (nextCell.IsCurrent) 
        { 
            nextCell.Focus(); 
            if (nextCell.ParentDataControl == null
            { 
                base.Focus(); 
            } 
            base.CurrentItem = nextCell.DataContext; 
        } 
        return nextCell.IsCurrent; 
    } 
    this.MoveFocus(new TraversalRequest(navigationDirection)); 
    return false

0
Hristo
Telerik team
answered on 09 Jun 2010, 04:18 PM
Hello Ramon de Klein,

You can find a trial version of our Q1 2010 SP2 under Your Account->Free Trials->RadControls for WPF or follow this link.

Kind regards,
Hristo
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ramon De Klein
Top achievements
Rank 1
answered on 09 Jun 2010, 04:36 PM
I found the 603 build under downloads. Thanks for the prompt reply.
Tags
GridView
Asked by
Mauricio
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Mauricio
Top achievements
Rank 1
aviv ron
Top achievements
Rank 1
Vlad
Telerik team
Ramon de Klein
Top achievements
Rank 1
Hristo
Telerik team
Ramon De Klein
Top achievements
Rank 1
Share this question
or