Position Selected Item in Listbox to Top

Posted on 2006-04-20
Last Modified: 2009-12-16

I have a VB.Net web page with a listbox:

<asp:ListBox id="lbxDelList" runat="server" forecolor="#000099" rows="10" Width="500px" SelectionMode="Multiple" TabIndex="1" AutoPostBack="True"></asp:ListBox>

When item 12 is selected from this Listbox (please note that I have rows set to Rows=10), I need item 12 to re-position to the top of the listbox.  What's happens in my case is that the item gets selected/hightlighted, but since it doesn't reposition, the user can't see it.

Since the listbox is SelectionMode=Multiple and I am displaying only "Rows=10" ....if the user selects item 5 and item 25,  I need the listbox to re-position showing item 5 at the top.

Thanks! msyed1
Question by:msyed1
    1 Comment
    LVL 23

    Accepted Solution

    Can't do it without lot of client side javascript code.
    If this kind of functionality is absolutely essential then you may want to look into thirdparty solutions for this kind of UI.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now