New to Telerik UI for WPF? Download free 30-day trial

F2 Should not Select All Text in RadGridView Cell


Product Version 2019.1 415
Product RadGridView for WPF


How to disable the text selection when a cell enters edit mode by pressing the F2 key.


  1. Create a custom RadGridView column and override its PrepareCellForEdit method.
  2. In the method override, get the editing element (TextBox) and manually set its SelectionStart property.

public class CustomGridViewDataColumn : GridViewDataColumn 
    protected override object PrepareCellForEdit(FrameworkElement editingElement, RoutedEventArgs editingEventArgs) 
        var cell = base.PrepareCellForEdit(editingElement, editingEventArgs); 
        var tb = editingElement as TextBox; 
        if (tb != null && !(editingEventArgs is MouseButtonEventArgs)) 
            tb.SelectionStart = tb.Text.Length; 
        return cell; 

    <local:CustomGridViewDataColumn DataMemberBinding="{Binding Name}" /> 

See Also

In this article