473,382 Members | 1,437 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,382 software developers and data experts.

select/highlight multiple rows listitems.

How do i do the following:

lbCountries.SelectedValue = "826";

lbCountries.SelectedValue = "840";

Basically i've set the selectmode to multiple and want to select multiple
values of the listbox on databind.

the problem is this only selects the last row "840" -- i would imagine this
would happen because i'm just replacing the value of selectedvalue. Does
anyone know how to select multiple values?

thanks all in advance

Marc

Nov 16 '05 #1
3 5613
us listbox.setselected method
example

lbCountries.SetSelected ( lbCountries.FindStringExact("826"), True )
lbCountries.SetSelected ( lbCountries.FindStringExact("840"), True )

Regards
Martin
"mike" <sp******@hotmail.com> wrote in message
news:X0*******************@doctor.cableinet.net...
How do i do the following:

lbCountries.SelectedValue = "826";

lbCountries.SelectedValue = "840";

Basically i've set the selectmode to multiple and want to select multiple
values of the listbox on databind.

the problem is this only selects the last row "840" -- i would imagine this would happen because i'm just replacing the value of selectedvalue. Does
anyone know how to select multiple values?

thanks all in advance

Marc

Nov 16 '05 #2
'System.Web.UI.WebControls.ListBox' does not contain a definition for
'SetSelected'

I get this error? :(
any ideas??

Thanks
Marc

"Martin Marinov" <me********@mecrossroad.bg> wrote in message
news:OD**************@TK2MSFTNGP12.phx.gbl...
us listbox.setselected method
example

lbCountries.SetSelected ( lbCountries.FindStringExact("826"), True )
lbCountries.SetSelected ( lbCountries.FindStringExact("840"), True )

Regards
Martin
"mike" <sp******@hotmail.com> wrote in message
news:X0*******************@doctor.cableinet.net...
How do i do the following:

lbCountries.SelectedValue = "826";

lbCountries.SelectedValue = "840";

Basically i've set the selectmode to multiple and want to select multiple values of the listbox on databind.

the problem is this only selects the last row "840" -- i would imagine

this
would happen because i'm just replacing the value of selectedvalue. Does
anyone know how to select multiple values?

thanks all in advance

Marc


Nov 16 '05 #3
Sorry, I was thinking of windows programing and windows ListBox

For web Listbox control you have to use
lbCountries.Items.FindByValue("826").Selected = true;

lbCountries.Items.FindByValue("840").Selected = true;

instead of

lbCountries.SetSelected ( lbCountries.FindStringExact("826"), True )
lbCountries.SetSelected ( lbCountries.FindStringExact("840"), True )

Hope This Helps
Regards
Martin

"mike" <sp******@hotmail.com> wrote in message
news:7D*******************@doctor.cableinet.net...
'System.Web.UI.WebControls.ListBox' does not contain a definition for
'SetSelected'

I get this error? :(
any ideas??

Thanks
Marc

"Martin Marinov" <me********@mecrossroad.bg> wrote in message
news:OD**************@TK2MSFTNGP12.phx.gbl...
us listbox.setselected method
example

lbCountries.SetSelected ( lbCountries.FindStringExact("826"), True )
lbCountries.SetSelected ( lbCountries.FindStringExact("840"), True )

Regards
Martin
"mike" <sp******@hotmail.com> wrote in message
news:X0*******************@doctor.cableinet.net...
How do i do the following:

lbCountries.SelectedValue = "826";

lbCountries.SelectedValue = "840";

Basically i've set the selectmode to multiple and want to select multiple values of the listbox on databind.

the problem is this only selects the last row "840" -- i would imagine

this
would happen because i'm just replacing the value of selectedvalue. Does anyone know how to select multiple values?

thanks all in advance

Marc



Nov 16 '05 #4

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

Similar topics

1
by: Gerg | last post by:
The datagrid has a tablestyle applied to it, and there are DataGridTextBoxColumn and each DataGridTextBoxColumn has an array of DataGridTextBox objects. Private Sub highlight(ByVal str As...
1
by: john woo | last post by:
Hi I'm not good at JS, but want to get more about it. I want to use a JSP (the java code just used to get date, the rest are html and javascript), to display a table. the requirement is the...
2
by: Bob Hollness | last post by:
Hi group. I am a newbie to ASP.NET as you will see from some of the questions I may ask! I have a datagrid which I have populated from a database. It works great! I have added a column, via...
4
by: Matt Ratliff | last post by:
Hello, I would appreciate any assistance you have with the following problem: I have (as an example) an array of values as follows: arrayvalues=new Array("0001","0003","0005") where each is the...
3
by: almurph | last post by:
Hi, I'm a newbie to Javascript. I can;t even finf a full API for it! Anyway I have a table structure and when a user presses the down-arrow button the item in said table is meant to be...
2
by: Andy Baker | last post by:
I have a VB.NET 2003 application that uses several datagrids. The behaviour I want from the datagrid is to select (highlight) the entire row when I click on any cell in a row. I have done this...
0
Merlin1857
by: Merlin1857 | last post by:
A thing I have been asked for on a number of occasions is the ability to highlight text after its been searched for in a record return page. The following does this perfectly. Use this function...
3
sujathaeeshan
by: sujathaeeshan | last post by:
Hello all, I want to highlight or select data grid row based on first letter of first column in data grid with keyboard. Just by pressing the key of first letter of the column ,it has to...
3
by: kirschey | last post by:
I have read the other posts on this subject, but I am still having issues. I have a few combo, and one multiselect list box for States delimiting. I am trying to feed a query based on this info. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.