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

Access the default editing element

Updated on Sep 24, 2025

This article will show how to access the default editing element of RadGridView's cells and set its properties. In addition, it will show how to alter the default behavior of selecting the whole text upon editing.

First, let's start with a real world scenario - you have a cell which shows a long text. You wrap the text by setting the TextWrapping="Wrap" property of the column. The text looks good in view mode, but when you enter edit mode - the full text is shown on one line:

how to access editing element Telerik WPF DataGrid 2

To make the editing textbox wraps the text as well you need to subscribe to the PreparingCellForEdit event, find the editing element and set its property:

C#
	private void clubsGrid_PreparingCellForEdit(object sender, GridViewPreparingCellForEditEventArgs e)
	{
	    if ((string)e.Column.Header == "Name")
	    {
	        var tb = e.EditingElement as TextBox;
	        tb.TextWrapping = TextWrapping.Wrap;
	    }
	}

Now it is better:

how to access editing element Telerik WPF DataGrid

Ok, what if I do not want have this text selected, but want to have the cursor positioned at the end of it? Here comes the other useful event - PreparedCellForEdit which fires when the cell is already prepared for editing:

C#
	private void clubsGrid_PreparedCellForEdit(object sender, GridViewPreparingCellForEditEventArgs e)
	{
	    if ((string)e.Column.Header == "Name")
	    {
	        var tb = e.EditingElement as TextBox;
	        tb.SelectionLength = 0;
	        tb.SelectionStart = tb.Text.Length;
	    }
	}
Not finding the help you need?
Contact Support