N
Norbert Ruessmann
Hello group,
I have a problem with ObjectDataSource and ITypedList.
At the end of this entry you find the implementatiopn of my List class,
derived from ArrayList and implementing ITypedList. All items contained in
the list are of type Person, which is a class derived from nothing and
implementing no Interfaces.
I put a DataSourceObject on my form and a Gridview. The DataSourceObject's
select method is GetAllPersons.
Now the problem: when running the form I see the grid with three columns for
the public properties of class Person, and the items of the list. But I do
not see this at design time.
Any help is appreciated.
Regards
Norbert Ruessmann
[DataObject(true)]
public class PersonsInArrayList : ArrayList , ITypedList
{
public PersonsInArrayList()
{
this.Add (new Person( 1 , "James" , "Cook" ));
}
public ArrayList AllPersons()
{
return this;
}
#region ITypedList Members
public PropertyDescriptorCollection
GetItemProperties(PropertyDescriptor[] listAccessors)
{
PropertyDescriptorCollection propsColl
=TypeDescriptor.GetProperties(typeof(Person));
return propsColl;
}
public string GetListName(PropertyDescriptor[] listAccessors)
{
Debug.WriteLine("PersonInArrrayList :: GetListName");
return "GrossElternCollection";
}
#endregion
}
I have a problem with ObjectDataSource and ITypedList.
At the end of this entry you find the implementatiopn of my List class,
derived from ArrayList and implementing ITypedList. All items contained in
the list are of type Person, which is a class derived from nothing and
implementing no Interfaces.
I put a DataSourceObject on my form and a Gridview. The DataSourceObject's
select method is GetAllPersons.
Now the problem: when running the form I see the grid with three columns for
the public properties of class Person, and the items of the list. But I do
not see this at design time.
Any help is appreciated.
Regards
Norbert Ruessmann
[DataObject(true)]
public class PersonsInArrayList : ArrayList , ITypedList
{
public PersonsInArrayList()
{
this.Add (new Person( 1 , "James" , "Cook" ));
}
public ArrayList AllPersons()
{
return this;
}
#region ITypedList Members
public PropertyDescriptorCollection
GetItemProperties(PropertyDescriptor[] listAccessors)
{
PropertyDescriptorCollection propsColl
=TypeDescriptor.GetProperties(typeof(Person));
return propsColl;
}
public string GetListName(PropertyDescriptor[] listAccessors)
{
Debug.WriteLine("PersonInArrrayList :: GetListName");
return "GrossElternCollection";
}
#endregion
}