New to Telerik UI for WPFStart a free 30-day trial

F2 Should not Select All Text in RadGridView Cell

Updated on Sep 15, 2025

Environment

Product Version2019.1 415
ProductRadGridView for WPF

Description

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

Solution

  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.
C#
	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;
		}
	}
XAML
	<telerik:RadGridView.Columns>
		<local:CustomGridViewDataColumn DataMemberBinding="{Binding Name}" />
	</telerik:RadGridView.Columns>

See Also