Hi there,
My users want me to change the default key navigation behavior on a hierarchical grid. For instance, they want the tab key to move down to the children of a hierarchical row if it's the end of the line instead of moving to the next row of the same level.
I implemented a solution that looks like this:
But I get the following exception sometimes when tabbing around quickly:
Object reference not set to an instance of an object.
at Telerik.WinControls.UI.ViewInfoTraverser.SetCollectionForStage()
at Telerik.WinControls.UI.ViewInfoTraverser.Reset()
at Telerik.WinControls.UI.ViewInfoTraverser..ctor(GridViewInfo viewInfo)
at Telerik.WinControls.UI.GridRowBehavior.IsOnLastCell()
at Telerik.WinControls.UI.GridRowBehavior.ProcessTabKey(KeyEventArgs keys)
at MyApp.CustomGridHierarchyRowBehavior.ProcessTabKey(KeyEventArgs keys) in C:\Dev\MySolution\MyApp\App_Code\CustomGridView.cs:line 141
at Telerik.WinControls.UI.GridRowBehavior.ProcessKey(KeyEventArgs keys)
at Telerik.WinControls.UI.BaseGridBehavior.ProcessKey(KeyEventArgs keys)
at Telerik.WinControls.UI.RadGridView.ProcessDialogKey(Keys keyData)
at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at MyApp.Program.Main() in C:\Dev\MySolution\MyApp\Program.cs:line 20
The line 141 in my custom method correlates to the call to "return base.ProcessTabKey(keys);".
Am I doing something wrong? Am I missing an important call to some helper method or forgetting to set some property? I've been experimenting with these behavior classes and have been having a lot of trouble with random/difficult to reproduce exceptions deep inside the guts of the grid.
I should also probably mention that my grid is three levels deep, in case that makes any difference (as it did for the issue with collapsing hierarchy rows). And I'm using VS 2008 and version 2010.2.10.914 of the Telerik controls.
Thanks for any insight!