Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a DropDownList which shows at least 100 details.
but OnMouseOver of DropDownList it should display only 10 recrods at a time and it should have an Vertical Scroll Bar so that the End user can use Scroll Bar in order to Select that specific Value

Thanks in Advance

Regards
Sushil Dharmar
Posted
Updated 21-Mar-12 8:04am
v2
Comments
Sergey Alexandrovich Kryukov 21-Mar-12 14:30pm    
Not a question. What have you done so far? What's the problems?
--SA
SushilDharmar 21-Mar-12 22:32pm    
The DropDownList Should Display only 10 Data Container at a time.
On OnClick Event of an DropDown List.
And for the Rest, the User should use the Vertical Scroll Bar for the Selection of an Item from the dropdown list.
Instead of having a long DropDownList box.

1 solution

Well dropdown list will be rendered in browser as html select and with the html select as far as I know you can not do what you ask for.

Instead, you can build your own control that has a readonly textbox and a listbox. You can limit the height of the control by setting the height property of the listbox.

OR you can use ListBox control and set the height of it to show 10 items.
OR you can also use AJAX AutoCompleteExtender

**Maybe you can try to do pagination on the data source for the drop down list using PagedDataSource and set the PageSize to 10.(Not sure about this one)

Also,
C#
<asp:DropDownList ID="DropDownList1" onmouseover="this.size=10;" onmouseout="this.size=1;" runat="server">
</asp:DropDownList>
can help you a bit but may not cover it all.


I hope these are helpful.

Good luck,
OI
 
Share this answer
 
v2

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