473,385 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Setting focus on the selected item in listbox

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

--
Thanks
Hitesh
May 16 '06 #1
2 4060
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]

"Hitesh" <Hi****@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
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

--
Thanks
Hitesh

May 17 '06 #2
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 [Microsoft MVP]" wrote:
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]

"Hitesh" <Hi****@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
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

--
Thanks
Hitesh


May 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Peter Moscatt | last post by:
I am having trouble understanding the methods for the Listbox from Tk. If I was to select at item in the list using a mouse click (have already created the bind event) - what method returns the...
8
by: tshad | last post by:
I have a string that I read from my database: 1|8|5620|541 These are all values in my ListBox. I want to select each of these items (4 of them - but could be many more). At the moment I am...
5
by: Paul | last post by:
Hi I have a listbox and have the selection mode set to multiple in the property box. I am trying to set multiple selected values in code but it only seems to use the last one....
3
by: Mitch | last post by:
Is the following a correct representation of the relationship of the selected index to selected item: INDEX ITEM 0 "item 1" 1 "item 2" 2 "item 3" and so on. I keep...
1
by: sf | last post by:
Hi, searching this group and othher sources didn't found a match. My problem: Working with VS C#.Net 2003 I have a ListBox and like to retrieve the item which has the focus - not the selected...
4
by: rn5a | last post by:
I am binding a DropDownList with records existing in a database table. I want to add an extra item *SELECT COMPANY* at index 0 so that by default, it gets selected. This is how I tried it but the...
6
by: probashi | last post by:
Hi, Issue: After post back selected item of a list box is getting out of focus (when it contains more items than it's size). I have a List Box in an ASPX page. I select an item from the...
0
by: waldedg | last post by:
I have a ListBox set as Multiselect. I am populating the table thruough asp.net code. But I am using another dataset to get the items that should be selected. The only item that ends up selected is...
1
by: Gerardo ARnaez | last post by:
Hi. I am writing a program to help determine coumadin regimens to look at the code: http://sourceforge.net/projects/coumadinregimen/ The issue is that I have a variable that I want the use to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.