Set Scroll bar to Selected Item in a multiple Select Listbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pbala
    New Member
    • Dec 2008
    • 37

    Set Scroll bar to Selected Item in a multiple Select Listbox

    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
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    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

    Comment

    Working...