Hi,
i developing a website where i to combine the data of each listbox(listbox is dynamically created) the list in listbox is selected by user and ther can be any number of listbox...i m stuck up how to combine and for the list...
eg: list1-->small,large,xlarge
list2-->orange,blank
list3-->pink,red
so the combination will be 1.small orange/pink 2.large orange pink3.xlarge orang/pink...and all the other combination..
plz help
combination of different ListboxHi, i developing a website where i to combine the data of each listbox
Page 1 of 1
2 Replies - 594 Views - Last Post: 03 May 2009 - 01:56 PM
Replies To: combination of different Listbox
#2
Re: combination of different Listbox
Posted 01 May 2009 - 08:06 AM
If I understand you on your site you have N number of list boxes and you want to create a string from using the selected item from each list box?
When you create your list box you could add it to a List of list boxes. Then when the user presses a button you could use a for/foreach loop of the list of list boxes, find the selected word of the list box and add it to the string. Once you have tried something, post some code and I'm sure others will try and help you.
When you create your list box you could add it to a List of list boxes. Then when the user presses a button you could use a for/foreach loop of the list of list boxes, find the selected word of the list box and add it to the string. Once you have tried something, post some code and I'm sure others will try and help you.
#3
Re: combination of different Listbox
Posted 03 May 2009 - 01:56 PM
if i understand your problem correctly the code underneath should be somewhat similar to what you want.
if it's not let us know.
if it's not let us know.
string tempString; tempString = string.Concat(listBox1.SelectedItem," " ,listBox2.SelectedItem," " ,listBox3.SelectedItem); textBox1.Text = tempString;
This post has been edited by LycHaf17: 03 May 2009 - 01:57 PM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|