C# Tutorials and offshore development in India
Tutorials Resources Forum Reviews Communities Interview Jobs Projects Training Videos


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...


Birthday Greetings
Learn Windows 7: How to change the Window Explorer bar half color?   This article is about the changing the color of window explorer bar half color. Step to change the window explorer bar half color.



Resources » Code Snippets » AJAX »

Solution for Dropdownlist or List to fit the lenghty items. (ASP.NET)


Posted Date: 19 May 2008    Resource Type: Code Snippets    Category: AJAX
Author: BharathiMember Level: Diamond    
Rating: 1 out of 5Points: 10



This is one of the solutions to fit the lengthy items of the dropdownlist:

By using ajaxToolkit: PopupControlExtender control.

Place the Dropdownlist in the popupcontrolextender like:
<ajaxToolkit:PopupControlExtender ID="<Control Name>" TargetControlID="<Target Control Id>" PopupControlID="<DropDownlist Id>" runat="server" />

Place a textbox and a dropdownlist. By setting the Target control as: Textbox, the user can see the textbox and on focus of the textbox the Dropdownlist will be popped up. Select a value from the dropdownlist and assign to the textbox.

Don’t specify the width for the dropdownlist, since the list should extended according to the length of the Listitems.

I the selectedindexchanged event of the dropdownlist call the function of ajaxcontrol as:

popupcontrolextender1.commit (dropdownlist1.selecteditem.text);

By doing so, the text of selected dropdownlist will be assigned as a textbox value and the popupcontrol gets hidden.






Responses to the resource: "Solution for Dropdownlist or List to fit the lenghty items. (ASP.NET)"

No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Using Ajax AutoCompleteExtender
Previous Resource: Hover Menu Control + GridView
Return to Resources
Post New Resource
Category: AJAX


Post resources and earn money!
 
More Resources



About Us    Contact Us    Privacy Policy    Terms Of Use