combination of different Listbox

Hi, i developing a website where i to combine the data of each listbox

Page 1 of 1

2 Replies - 734 Views - Last Post: 03 May 2009 - 01:56 PM Rate Topic: -----

#1 spolierSneha007  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 01-May 09

combination of different Listbox

Posted 01 May 2009 - 12:29 AM

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

Is This A Good Question/Topic? 0
  • +

Replies To: combination of different Listbox

#2 SixOfEleven  Icon User is offline

  • using Caffeine;
  • member icon

Reputation: 945
  • View blog
  • Posts: 6,342
  • Joined: 18-October 08

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.
Was This Post Helpful? 0
  • +
  • -

#3 LycHaf17  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 02-May 09

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.

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

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1