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

Valid entry issue

1 Answer 31 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Phil H.
Top achievements
Rank 2
Phil H. asked on 01 Oct 2014, 01:50 PM
Hi:

We are working with some existing code.  The RadDropDownList controls throughout the application allows any data entry in the control (for example: a list of USA states, I could enter Fred and tab out of the field).  Currently, all RadDropDownList controls DropDownStyle are set to DropDown.  What are the best practices constraining the users data entry to the supplied list.

Phil

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 06 Oct 2014, 06:32 AM
Hi Phil,

Thank you for writing.

In order to make the text area of the RadDropDownList read-only you should just set the DropDownStyle property to DropDownList. This way the user will not be able to edit the text and he/she should chose from one of the predefined options.

If you do not want to change the drop down style for some reason, you can use the Validating event and cancel the change and perhaps display a message to the user.

I hope this helps. Let me know if you have additional questions.

Regards,
Dimitar
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
DropDownList
Asked by
Phil H.
Top achievements
Rank 2
Answers by
Dimitar
Telerik team
Share this question
or