: :
: : public string ItemList
: : {
: : get
: : {
: : foreach (Thing thing in _Things)
: : {
: :
: : _itemList = thing.Name;
: : //so far this is the only way i can
: : //show multiple thing.Names in _Things
: : // but i want to return this, not write it to
: : //the console.
: : Console.WriteLine("{0}",_itemList);
: :
: : }
: :
: : return _itemList;
: : }
: :
: : }
: :
: :
: :
: : i want to return all of the thing.Names in _Things (_Things is a list of thing)...i that makes sense......
: :
: : I added more than one thing into the _Things list,, but it is only returning the last thing.Name in the _Things list..........
: :
: : this may not make much sense but if any1 can help..that would b great
: :
:
: hi,
: Sure, just use an array in your 'foreach'-loop. Fill that array with your list items, and return your array on the place where in your code 'return _itemList;' stands.
: good luck
:
Thanks heaps...worknin nice now