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

NonEditable Keyboard Input Autocomplete Delay

3 Answers 128 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 11 Jun 2009, 07:42 PM
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.

3 Answers, 1 is accepted

Sort by
0
Accepted
Valeri Hristov
Telerik team
answered on 15 Jun 2009, 01:36 PM
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.
0
Richard
Top achievements
Rank 1
answered on 17 Jun 2009, 04:09 PM
Sounds excellent! Thanks!
0
Michael
Top achievements
Rank 1
answered on 22 Jul 2009, 08:46 PM
+1 for this feature.Disallowing custom text in the type ahead is my number one control request from Business Analysts.
Tags
ComboBox
Asked by
Richard
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Richard
Top achievements
Rank 1
Michael
Top achievements
Rank 1
Share this question
or