Connect with Expertise | Find Experts, Get Answers, Share Insights

Set Scroll bar to Selected Item in a multiple Select Listbox

pbala's Avatar  
Join Date: Dec 2008
Location: Tamil Nadu
Posts: 37
#1: Feb 1 '10
I have a multiple select Listbox.When I click on it then it post backs and scroll back to the top of the Listbox.
Is there any property to prevent it?

Frinavale's Avatar
E
M
C
 
Join Date: Oct 2006
Location: The Great White North
Posts: 7,073
#2: Feb 1 '10

re: Set Scroll bar to Selected Item in a multiple Select Listbox


I could be wrong but I don't think so.

You can use JavaScript to reset the scroll position though. When the page is submitted to the server store the scroll position in a HiddenField (make sure it's an ASP.NET HiddenField so that the ViewState can be remembered). That way when the request comes back you can use JavaScript to retrieve the scroll position and reset the scroll position.

-Frinny
Reply