
I am guessing that you are setting the value of the cell/property and then entering edit mode. As with the Autocomplete Textbox the character typed to enter edit mode is selected so any other characters entered overwrite the first character pressed.
I could scrap the Auto complete text box as an editor but then when users Tab from cell to cell in edit mode the contents will not be selected.
12 Answers, 1 is accepted
I think that you do not need any special AutoSelect(Complete)TextBox controls for editors, since that you are describing the RadGridView's default editing + TAB navigation behavior. Let me clarify a little bit. When TAB key is pressed and current cell is in edit mode then RadGridView moves focus to the next editable cell's editing element. If this element is a custom control set via CellEditTemplate RadGridView sets focus to the first control which can take focus and if this control is textbox selects all text of it.
Could you please try your scenario with default columns and let me know about the result?
Nedyalko Nikolov
the Telerik team

Is that documented anywhere else?
I'm experiencing a problem that when a cell that is focused, but not in edit mode, and the user types a single key (e.g. "2"), the cell enters edit mode, the existing content is replaced by "2" and the entire TextBox's contents are selected. So then they try to type their second character, "3" and the 3 replaces the 2 instead of appending to it.
I've been struggling to find out why this is happening when I stumbled upon this thread suggesting the Telerik controls might purposefully be doing this.

http://demos.telerik.com/silverlight/#GridView/CellEditTemplate
Thank you for reporting this issue. The difference is in the editor. "Name" column is edited via TextBox, and "Date" column by RadDateTimePicker. We will fix this with the upcoming service pack.
I've updated your Telerik points accordingly.
Kind regards,
Nedyalko Nikolov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.


The expected behavior should be to have a "23|" text inside RadDateTimePicker if DateTime cell is focused and "23" is entered via keyboard. Unfortunately we've managed to fix this issue for WPF (and I wrote you), but there is a problem with Silverlight (as you know we share a common code base and I do not expect any problems but...). I've just talked with the team responsible for RadDateTimePicker control and they ensured me that this issue will be fixed with high priority, so you could expect a fix with one of the internal builds that follow the upcoming service pack.
Sorry for the inconvenience caused.
Nedyalko Nikolov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

My actual problem is not with RadDateTimePicker. I'm not using a RadDateTimePicker. If a problem exists with it, I'm not aware of it.
Instead, my problem is with a TextBox. See my "Amount Used" column here:
<
telerik:RadGridView
x:Name
=
"MyDataGrid"
Grid.Row
=
"1"
AutoGenerateColumns
=
"False"
ShowGroupPanel
=
"False"
ShowInsertRow
=
"False"
IsFilteringAllowed
=
"True"
RowIndicatorVisibility
=
"Collapsed"
VerticalAlignment
=
"Stretch"
ItemsSource
=
"{Binding Path=MyData}"
ScrollViewer.VerticalScrollBarVisibility
=
"Visible"
SelectedItem
=
"{Binding Path=SelectedDataItem, Mode=TwoWay}"
CanUserInsertRows
=
"False"
CanUserDeleteRows
=
"False"
AlternateRowBackground
=
"#008CFFFF"
HorizontalAlignment
=
"Left"
TelerikRadGridView:Empty.EmptyDataTemplate
=
"{StaticResource EmptyTemplate}"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"Column A"
Width
=
"*"
>
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
TextBlock
Foreground
=
"{Binding IsApplicable, Converter={StaticResource ApplicabilityColorConverter}}"
Text
=
"{Binding Description}"
/>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Amount Available"
Width
=
"Auto"
>
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
StackPanel
>
<
TextBlock
Foreground
=
"{Binding Available, Converter={StaticResource CurrencyColorConverter}}"
Text
=
"{Binding Available, StringFormat=\{0:n2\}}"
HorizontalAlignment
=
"Right"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Amount Used"
Width
=
"Auto"
IsFilterable
=
"False"
TextAlignment
=
"Right"
>
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding UsedValue, Converter={StaticResource UsedValueTextConverter}}"
HorizontalAlignment
=
"Right"
/>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
<
telerik:GridViewDataColumn.CellEditTemplate
>
<
DataTemplate
>
<
TextBox
Text
=
"{Binding UsedValue, Mode=TwoWay, Converter={StaticResource UsedValueTextConverter}}"
HorizontalContentAlignment
=
"Right"
></
TextBox
>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellEditTemplate
>
</
telerik:GridViewDataColumn
>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
When the "Amount Used" column is focused, but NOT in edit mode, and I press a key (e.g. "1"), the cell enters edit mode, its contents are replaced with a string comprised solely of the new key (e.g. "1") and the TextBox's contents are entirely selected. So as I press the second key (e.g. "2" to try and achieve the string "12" in the TextBox), the contents are *replaced* with the string "2" (because the "1" had been selected).
Now I had assumed this was some bug of mine until I found this old thread. Earlier in this thread, it was stated, "If this element is a custom control set via CellEditTemplate RadGridView sets focus to the first control which can take focus and if this control is textbox selects all text of it". I am in fact used a custom CellEditTemplate that is a TextBox, so that behavior I observe seems to match what is described in this thread.
But that behavior is a problem for me. It means a user can't just start typing on a focused but non-edit-mode cell because their first keystroke will be lost when the subsequent keystrokes start replacing that text due to the autoselect.
The unnatural and frustrating behavior I experience with my TextBox is very much like the RadDateTimePicker behavior in the example I cited. That is why I mentioned RadDateTimePicker. But my problem is with RadTextBox.
So let me ask some very direct questions:
- Is the following still true: "If this element is a custom control set via CellEditTemplate RadGridView sets focus to the first control which can take focus and if this control is textbox selects all text of it."?
- If #1 is true, where is that documented?
- If #1 is true, is there a way to STOP that behavior?

Could you confirm that you observe the described behavior with our latest version?
Just for test could you remove the binding converter (or send it to me in order to test on my side).
Indeed RadGridView places focus on the first child element that could take focus and if this is a textbox the entire text is selected. However this is not the case when editing is invoked via key press then selection is places and the end of the text.
We will add this to our documentation.
You could change this behavior by handling RadGridView.PreparedCellForEditevent.
Hi Tommy
I'm sorry to understand that you have problems with editing for years.
Could you please give me a little bit more info about your problem (a sample project will be great)?
I'll be glad to assist.
Nedyalko Nikolov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

As far as trying the latest controls, I'll have to wait a little bit to try that. This bug was reported against a release that is undergoing QA. We never upgrade third party library versions in a QA release. While Telerik's release are always high quality, we don't have the time to fully regression test everything so late in our QA process. I'll recommend we slate this bug to be fixed in our next release (currently under development) where it is still open for bigger changes.
FWIW, we're on Q3 2012 (version 2012.3.1314.1050). The latest is Q1 2013 (should be version 2013.1.xxxx.xxxx).
Could you please send me the code inside "UsedValueTextConverter"? I'll test it on my side and let you know about the result. We do not have any pending problem with keyboard editing, so I'm very surprised that you have problems with the TextBox editor.
Thank you in advance.
Nedyalko Nikolov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.