Click here to Skip to main content
15,926,281 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I want to edit my dropdownlist box like textbox. I have tried it many times. But I couldn't.
I don't want to use ajax tool.
Is there any way that help me to alter my default dropdownlist box in edit mode.
Please help me. Thanks in advance.
Posted
Comments
Sergey Alexandrovich Kryukov 2-Sep-13 11:00am    
Edit what? Each item? Then you need to design some UI which would edit it. http://whathaveyoutried.com?
—SA

Please see my comment.

First of all, you should understand how ASP.NET works in a Web application. There are no such HTML elements as "drop-down list" or "text box". ASP.NET code works on the server side and generate pure normal HTML content, without all those ASP.NET Wen controls. In particular, the only control elements where a user can enter some text would be <input type="text"> or <textarea> elements, both are represented by the ASP.NET TextBox control. This is all you can use for editing.

Now, it's up to you to design the code which would present such input element to the user. In principle, you can even mimic in-place editing of a list element, but it would not so simple. When a user edits the text and hit Enter or clicks some button or other control meaning committing the edited text to the drop-down list, you should write some JavaScript to update, say, the selected item of a list to be edited.

This is your job to do. If you try to design and implement something like that and have some particular difficulties you can clearly explain, you are welcome to ask your questions; we will gladly try to help you.

—SA
 
Share this answer
 
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900