Position Selected Item in Listbox to Top
Posted on 2006-04-20
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.