Click here to Skip to main content
16,008,183 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
i have a collection of custom objects, if in some cases i know the item(custom object), i need to know the collection that contains item. how to refer the collection from its item..?

Thanks and Regards
Easwar
Posted

1 solution

Unless you have added a reference to the collection to your object and update it whenever you add or remove it from a collection, there is no easy way to tell.

You can check the possible collections to see if they contain an object using the Contains method, but there is no automatic back reference from an object to a collection, except in special cases like the TreeView where it is specifically added.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900