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