Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Binding a Multi Select ListBox 1

Status
Not open for further replies.

IT4EVR

Programmer
Feb 15, 2006
462
US
I have a FormView that includes a ListBox that can contain multiple selections. Is there a way to bind this to a data source for multiple values or would I have to create this functionality in code?
 
Is there a way to bind this to a data source for multiple values or would I have to create this functionality in code?
Not sure what you mean by this. Do you mean you want to bind the values and have multiple values selected as it binds?
 
Yes, I don't believe such a functionality exists but maybe someone out there knows something I don't.

I'm thinking I will have to take this control out of the template and programmatically bind it. SelectedValue will only bind to one value I believe.
 
Looks like you will need the databound event of the listbox to do what you want.
 
Thanks, that saved me some time. That's a good idea.

I think I may be better off eschewing the formview control and just building a regular web form with a data access class.

I'd like to populate the form controls and the listbox simultaneously. I could do that by returning two queries in one stored procedures to the client.

I populate a main dropdownlist initially. Based on the user's selection, I then populate the form controls. I convert the values for the listbox into an array, which determines the items selected.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top