Hi:
I have a function that uses a generic collection as a parameter and the type of the XpObject to retrieve. :
public void Search(Type Tipo, XPCollection Collection) (This serach function must work with all kind of objects so i use a generic collection into it)
When i use into a form with visual insertion of the collection and setting this propertyes of ObjectClassInfo to Tipo the Functions works (i can see this code in the designer Collection.ObjectType= typeof(Objectype)
but i i work in code:
XPCollection Collection = new XPCollection()
Search (typeof(Objecttype),XPCollection Collection)
The function gives an error because the type of the collection is empty ( i try to add an ObjectType cast to XPBaseObject to the collection) If i do
Collection.ObjecType = typeof(Objectype) prior to calling search i get an error that says "Cannot change the ObjectType property when XPCollection is not in design or initialization mode.
Any idea in how can i can do this?