1
Answer

Get object in Collection by Name

neubs007

neubs007

20y
4.5k
1
I have the following classses: Item Property :String Name +10 other Properties Items ~ able to add & remove Item Objects as needed and access an Item object by using the following syntax myCollectionOfItems[0].name. My question is How can I access the item in this collection by entering the "Name" property and not the Index that it was placed in the Items Collection? I want to be able to enter myCollectionOfItems["NameOfItem"] and have it return that Item Object. I want to access it similar to a datarow where you can either enter in the index or the string name of the column you want to access. Any Ideas????
Answers (1)