Focus puts the cursor at the start of the autocompeletebox

5 posts, 0 answers
  1. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 03 May 2013 Link to this post


    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);
    }
  2. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 06 May 2013 Link to this post

    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?
  3. DevCraft banner
  4. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 09 May 2013 Link to this post

    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.

  5. danparker276
    danparker276 avatar
    389 posts
    Member since:
    Aug 2010

    Posted 09 May 2013 Link to this post

    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.
  6. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 13 May 2013 Link to this post

    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.

Back to Top
DevCraft banner