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

Select item based on first letter

7 Answers 176 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Marty
Top achievements
Rank 1
Marty asked on 20 Jan 2009, 03:47 PM

I have the following combo box in many places in my code:

<telerik:RadComboBox ID="cboSystem" runat="server" > 
  <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</telerik:RadComboBox> 

When you tab into the box and want to type the first letter of item you want to select... it snaps to that item without issue if they start with an uppercase character.  If they start with a lower case character, then it does not snap to the item.

Example:
A RadCombobox contains 3 items:
  • dog
  • cat
  • Lizard

When you tab into this box and type 'l' (cap locks doesn't matter), it selects Lizard, as I would expect it to.  However, if you tab into the same box, and type 'd' or 'c', it does not snap to the items as you would expect and as it did with the 'l'.

I do not want to allow editable text in the combo box, but is there a property that will tell it to ignore case when snapping to an item in a combobox like that above?

Any input is appreciated. 

Thanks,
Marty

7 Answers, 1 is accepted

Sort by
0
Serrin
Top achievements
Rank 1
answered on 20 Jan 2009, 06:08 PM

Heya Marty,

Hmm, if you use AllowCustomtext=False and MarkFirstMatch=True you should get the desired result.  I just tested the following:

<telerik:RadComboBox ID="cboSystem" runat="server" AllowCustomText="false"   
                     MarkFirstMatch="true" >    
    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>    
        <Items> 
            <telerik:RadComboBoxItem Text="dog" /> 
            <telerik:RadComboBoxItem Text="cat" /> 
            <telerik:RadComboBoxItem Text="Crayon" /> 
            <telerik:RadComboBoxItem Text="Lizard" /> 
        </Items> 
</telerik:RadComboBox>  

... and regardless of what case (using caps lock or shift) I typed, I would get cat for c/C, Lizard for l/L, and dog for d/D.  Try adding those properties to your combobox to see if it is achieving the desired result.
0
Marty
Top achievements
Rank 1
answered on 20 Jan 2009, 07:59 PM
Hey Serrin,

Thank you for the quick reply.

Yes the suggested changes DO work... however, you lose the ability to continue pressing the same key to move to the next item in the combobox that starts with that letter.  That is because of the MarkFirstMatch=true attribute.

Setting it to true - you successfully go to the first item that start with the letter pressed, regardless of case, but no further if you press the same key again.
Setting it to false - you get the same behavior I started with.

Is there any other way around this that would still allow multiple key presses to go on to the next item starting w/the same letter?

Thanks again,
Marty
0
Yana
Telerik team
answered on 23 Jan 2009, 09:01 AM
Hi Marty,

This issue will be fixed in the next official release. Thank you for reporting it.

All the best,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Marty
Top achievements
Rank 1
answered on 30 Mar 2009, 02:18 PM
Hi,

I'm assuming that Q1 2009 counts as the next official release, I'm just curious if this was addressed.  In my app, using the latest version of the controls Q1 '09, this behavior still occurs as described in my original post.  Is there some attribute I need to set in order to acheive my desired result or was it not implmented?  Thanks.

Marty
0
Marty
Top achievements
Rank 1
answered on 31 Mar 2009, 06:50 PM
Anybody?
0
Yana
Telerik team
answered on 01 Apr 2009, 08:57 AM
Hello Marty,

This issue is not fixed yet, but is logged in our bug-tracking system and we'll do our best to address it for the SP1 which will be available by the end of the week.
 
In case we don't manage to fix it for the service pack, you could download an internal build as soon as it's addressed. Thank you for your understanding. 

All the best,
Yana
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Marty
Top achievements
Rank 1
answered on 01 Apr 2009, 12:17 PM
Thank you.
Tags
ComboBox
Asked by
Marty
Top achievements
Rank 1
Answers by
Serrin
Top achievements
Rank 1
Marty
Top achievements
Rank 1
Yana
Telerik team
Share this question
or