NonEditable Keyboard Input Autocomplete Delay

4 posts, 1 answers
  1. Richard
    Richard avatar
    17 posts
    Member since:
    Nov 2008

    Posted 11 Jun 2009 Link to this post

    I understand that even the NonEditable RadComboBox will take keyboard input to navigate to values that match the letters typed, but the functionality of the RadComboBox is lacking compared to traditional pull-down menus both on the web and within operating systems.

    May I suggest the following feature request, modeled after typical Microsoft Windows pull-down menus:

    1. The text input should be reset the moment a keystroke is entered that returns no matches.
    2. Backspace input is no longer required for the NonEditable RadComboBox, based on the above request. Of course, you will want to keep backspace input for the Editable RadComboBox.

    And here's how it's handled within web browsers:

    1. Text input is reset after 1 second of no keystrokes.

    That's pretty much it. Obviously, the 1st Windows-based functionality is the most powerful, but the 2nd web-based functionality is a step forward from the way the RadComboBox works right now, unless I'm totally overlooking something.

    Here's a basic rundown of the logic:

    using System.Text.RegularExpressions; 
     
    private string userInput; 
    private Regex alphaNumeric; 
     
    public ESOComboBox() 
        InitializeComponent(); 
        alphaNumeric = new Regex("[\\w\\s]+", RegexOptions.IgnoreCase);  // Alphanumeric, underscores and spaces
     
    private bool SelectMatchedComboItem(RadComboBox combo) 
        foreach (RadComboBoxItem item in combo.Items) 
        { 
            if (item.Content.ToString().StartsWith(userInput)) 
            { 
                combo.SelectedItem = item
                return true; 
            } 
        } 
        return false; 
     
    private void ESOComboBox_GotFocus(object sender, RoutedEventArgs e) 
        userInput = null
     
    private void ESOComboBoxKeyDown(object sender, KeyEventArgs e) 
        switch (e.Key) 
        { 
            case Key.Back: 
            case Key.Enter: 
            case Key.Escape: 
            case Key.PageUp: 
            case Key.PageDown: 
            case Key.End: 
            case Key.Home: 
            case Key.Left: 
            case Key.Up: 
            case Key.Right: 
            case Key.Down: 
                break; 
            default: 
                char ch = Convert.ToChar(e.PlatformKeyCode); 
                if (alphaNumeric.IsMatch(ch.ToString())) 
                { 
                    userInput += ch; 
                    RadComboBox combo = sender as RadComboBox; 
                    if (!SelectMatchedComboItem(combo)) 
                    { 
                        userInput = ch.ToString(); 
                        SelectMatchedComboItem(combo); 
                    } 
                } 
                e.Handled = true
                break; 
        } 

    I'm sure you guys will do a much better job with the logic on your end, but this is the general idea of where I was going with this. I still can't get it to work with the code above, but I can't really override some of the functions I want to to make it work, like the RadComboBoxKeyDown event or the textInput variable.


    • The latest version of Silverlight 2 is installed, version Silverlight 2 GDR 1 (2.0.40115.0).
    • Operating System: Windows Vista Home Premium (32-bit).
    • Attempted Browsers: Internet Explorer 8.0.6001.18702, Mozilla Firefox version 3.0.10, Google Chrome 2.0.172.28.
    • Telerik version: 2009.1.413.1020.
    • Preferred programming language: C#.
    • Microsoft Visual Studio 2008 Professional Edition, Version 9.0.30729.1 SP.
    • Microsoft Expression Blend 2 Service Pack 1, Version 2.1.1760.0.
  2. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 15 Jun 2009 Link to this post

    Hi Alex,

    Thank you for the feature request. We will definitely change the current behavior of the RadComboBox autocomplete to exactly match its windows and web counterparts. However, since the Q2 2009 release is already near (end of June/beginning of July) I cannot promise that we will include this feature in it. The earliest feasible timeframe would be one of the weekly internal builds after Q2, which is virtually less than a month.

    Sincerely yours,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Richard
    Richard avatar
    17 posts
    Member since:
    Nov 2008

    Posted 17 Jun 2009 Link to this post

    Sounds excellent! Thanks!
  4. Michael
    Michael avatar
    4 posts
    Member since:
    Feb 2009

    Posted 22 Jul 2009 Link to this post

    +1 for this feature.Disallowing custom text in the type ahead is my number one control request from Business Analysts.
Back to Top