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

Focus puts the cursor at the start of the autocompeletebox

4 Answers 276 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
danparker276
Top achievements
Rank 2
danparker276 asked on 04 May 2013, 12:34 AM

When I tab to my autocomplete box, it puts the cursor at the start of the autocompletebox.  But this only happens when I set the selected item programatically.  When I type it in and then tab back to it, it puts the cursor at the end.
This causes a problem because when I tab and the cursor is at the start, the search text goes blank.
And I can even catch that on a key down.


Everytime I try to do a combobox/autocomplete it takes me about 2-3 days to get it the way I want it.  Then I notice some bug that screws everything up.  

I think the most common way people want to use a combo/search box is to start typing, catch the first few letters and tab out to the next field.  Even that doesn't work.  Even when I'm on append mode, when I catch the first few letters and tab out, it just selects the item and keeps the focus on the autocomplete box.  Now I can catch this by the keyup also.  But then a strange thing happens.  If I tab to that autoCompleteBox, it automatically kicks me out to the next tabfield.  For some reason it things that I clicked the tab inside the autocomplete control.

Now I saw something was fixed in a WPF autocomplete focus issue recently.  I have the latest silverlight 2013.1.403.  I'm not sure if it's fixed there or not.  I guess it doesn't matter, because I'm just going to use a regular ordinary textbox, and do the filtering and focus on my own.  

I've wasted 3 work days on this issue that started from me having to move away from the radcombobox because even when virtualized, a keypress took 2 seconds to register in the combo box. (This was an issue with over 100,000 items)

I think you're trying to add too much to your RadCombo/Autocomplete box.  I just want to start typing, see a match, tab out, put the matched value in the textbox

EDIT:
Well I guess I can probably use this to fix the focus. 
private void rc1_GotFocus(object sender, RoutedEventArgs e)
{
    TextBox ch = FindChild<TextBox>(rc1);
    ch.Select(ch.Text.Length, 0);
}

4 Answers, 1 is accepted

Sort by
0
danparker276
Top achievements
Rank 2
answered on 06 May 2013, 04:25 PM
I guess my main question now is why doesn't the auto-complete box tab (on append) work like the autocomplete on the RadCombo box?
0
Ivo
Telerik team
answered on 09 May 2013, 07:52 AM
Hi Dan,

The first thing you mentioned is actually by design and can be observed in a regular TextBox control. In order to achieve what you want you will have to find the children TextBox control and set its SelectionStart property.
I am not sure I fully understand the second thing you mentioned. Can you give us more details on it? A video or a sample project that demonstrates it would be great.

Regards,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
danparker276
Top achievements
Rank 2
answered on 09 May 2013, 07:47 PM
When I type the first few letter and click 'TAB' I want it to auto-complete the value for me and move to the next tabitem.
When I click TAB it auto-completes, but doesn't move to the next tab item.
0
Ivo
Telerik team
answered on 13 May 2013, 08:07 AM
Hi Dan,

This issue will be fixed for one of the upcoming internal releases.

Kind regards,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
AutoCompleteBox
Asked by
danparker276
Top achievements
Rank 2
Answers by
danparker276
Top achievements
Rank 2
Ivo
Telerik team
Share this question
or