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

GridViewCell in next row goes to edit mode

1 Answer 147 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Raghavendar
Top achievements
Rank 1
Raghavendar asked on 09 May 2017, 02:25 PM

Hi,

I'm using RadGridView with multiple columns for which first column is editable with EditTrigger as 'F2'. The value is these will be unique and any conflict is handled by setting HasValidationErrors to true after committing the change and validating the same. The cell will be put back to edit mode in case of a conflict.

In a specific case where there is an error on the cell and the user handles it (by providing a unique value) and commits the change (handled in Enter press), then the error on that cell is removed and the row gets focused. Now when a Down/Up arrow key is pressed, the focus shifts to the row below/above and the cell goes to Edit mode which is not desired. 

Similar behavior is seen when 'Tab' key is pressed on and cell that is in editable mode -> Cell in the next rows goes to edit mode.

Below is the call stack which puts the cell in edit mode.

.................

Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewCell.IsInEditMode.set(bool value) Unknown
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.SwitchCellToEditMode(Telerik.Windows.Controls.GridView.GridViewCell cell) Unknown
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.BeginEdit(Telerik.Windows.Controls.GridView.GridViewCell gridViewCell, System.Windows.RoutedEventArgs editEventArgs) Unknown
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.BeginEdit(System.Windows.RoutedEventArgs editEventArgs) Unknown
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.OnBeginEditCommand(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) Unknown
  PresentationCore.dll!System.Windows.Input.CommandBinding.OnExecuted(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) Unknown
  PresentationCore.dll!System.Windows.Input.CommandManager.ExecuteCommandBinding(object sender, System.Windows.Input.ExecutedRoutedEventArgs e, System.Windows.Input.CommandBinding commandBinding) Unknown
  PresentationCore.dll!System.Windows.Input.CommandManager.FindCommandBinding(System.Windows.Input.CommandBindingCollection commandBindings, object sender, System.Windows.RoutedEventArgs e, System.Windows.Input.ICommand command, bool execute) Unknown
  PresentationCore.dll!System.Windows.Input.CommandManager.FindCommandBinding(object sender, System.Windows.RoutedEventArgs e, System.Windows.Input.ICommand command, bool execute) Unknown
  PresentationCore.dll!System.Windows.Input.CommandManager.OnExecuted(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) Unknown
  PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) Unknown
  PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) Unknown
  PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) Unknown
  PresentationCore.dll!System.Windows.Input.RoutedCommand.ExecuteImpl(object parameter, System.Windows.IInputElement target, bool userInitiated) Unknown
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.ExecutePendingCommand() Unknown
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.OnSelectCurrentUnitCommand(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) Unknown
  PresentationCore.dll!System.Windows.Input.CommandBinding.OnExecuted(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) Unknown
  PresentationCore.dll!System.Windows.Input.CommandManager.ExecuteCommandBinding(object sender, System.Windows.Input.ExecutedRoutedEventArgs e, System.Windows.Input.CommandBinding commandBinding) Unknown
  PresentationCore.dll!System.Windows.Input.CommandManager.FindCommandBinding(System.Windows.Input.CommandBindingCollection commandBindings, object sender, System.Windows.RoutedEventArgs e, System.Windows.Input.ICommand command, bool execute) Unknown
  PresentationCore.dll!System.Windows.Input.CommandManager.FindCommandBinding(object sender, System.Windows.RoutedEventArgs e, System.Windows.Input.ICommand command, bool execute) Unknown
  PresentationCore.dll!System.Windows.Input.CommandManager.OnExecuted(object sender, System.Windows.Input.ExecutedRoutedEventArgs e) Unknown
  PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) Unknown
  PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) Unknown
  PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) Unknown
  PresentationCore.dll!System.Windows.Input.RoutedCommand.ExecuteImpl(object parameter, System.Windows.IInputElement target, bool userInitiated) Unknown
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.ExecutePendingCommand() Unknown
  Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.NextCellFocusedAction.AnonymousMethod__37(System.Windows.FrameworkElement f) Unknown

...........

Please provide info on why this behavior is seen.

Regards,

Raghavendar.K

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 12 May 2017, 10:21 AM
Hi ,

This behavior is caused by our default implementation of Keyboard Command Provider. If you want to change it you can easily replace it with your custom logic. In the presented article you can find several ways on how to do that.

I hope that this helps.

Regards,
Martin Vatev
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Raghavendar
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or