Setting focus on the selected item in listbox

G

Guest

I have a listbox and the values get selected (highlighted) from code. I can
highlight the corresponding list box
items, but they do not show in the listbox I have to scroll through the list
box to find them. How can I setFocus on the highlighted data items in the
listbox after they are highlighted.

The selection mode is set to multiple for the listbox
 
K

Ken Cox [Microsoft MVP]

I'm not clear on what you're trying to do. Is it that you want the selected
items to appear together at the top of the list rather than being scrolled
out of view? That would require re-ordering the items.

Ken
Microsoft MVP [ASP.NET]
 
G

Guest

Noope i do not want the selected items to appear together at the top rather i
want being scroll down to the selected item in the list box.

From code i am selecting some item from the list box which is somewhere in
the mid of the list box and not visible because of the height of the list box
so in this case i want that as soon the page appears the list box is scrolled
automatically to the position where the selected element is.

Please let me know if things are not clear to you.
--
Thanks
Hitesh


Ken Cox said:
I'm not clear on what you're trying to do. Is it that you want the selected
items to appear together at the top of the list rather than being scrolled
out of view? That would require re-ordering the items.

Ken
Microsoft MVP [ASP.NET]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top