ComboBox: How to prevent Text entry

2 Answers 7 Views
ComboBox
Joel
Top achievements
Rank 2
Iron
Iron
Iron
Joel asked on 15 May 2025, 10:13 PM
How do I prevent the user from typing text into the text field in the combobox?
                                        <TelerikComboBox @bind-Value="@SessionOptionIndex1"
                                                         Data="@SessionOption1Items"
                                                         ShowClearButton="false"
                                                         TextField="Name" ValueField="Id" />

2 Answers, 1 is accepted

Sort by
0
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
answered on 16 May 2025, 11:05 AM
Hi Joel,

If you want to prevent the user from typing into the text field, you should use the TelerikDropDownList component instead of the TelerikComboBox.

The TelerikComboBox is designed to allow typing and even custom value entry (if enabled), whereas the TelerikDropDownList is strictly for selecting from predefined options and does not allow user input.

Regards,
Anislav Atanasov
0
Hristian Stefanov
Telerik team
answered on 16 May 2025, 12:43 PM

Hi all,

Indeed, the TelerikDropDownList component is more suitable for scenarios where you don't want users to type in the input. One of the main purposes of the ComboBox is to allow typing to help users find a specific item.

However, if you still prefer to use the ComboBox, you can prevent typing by using a small JavaScript function — similar to the example shown here: How to Restrict Numeric Input in ComboBox.

Regards,
Hristian Stefanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
ComboBox
Asked by
Joel
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Hristian Stefanov
Telerik team
Share this question
or