Using the NewItemTypes attribute is not taken into account in the collectionControl of the PropertyGrid since v2.3.
Comments: ** Comment from web user: BoucherS **
Hi,
v2.8 will be the next version available for the Plus users. It will then become available to the Community users a bit later.
Since it was working before, here is a fix :
In file :
-Xceed/Wpf.Toolkit/PropertyGrid/Implementation/Editors/CollectionEditor.cs
in method :
-ResolveValueBinding( PropertyItem propertyItem )
Replace :
```
else if( type.GetGenericArguments().Count() > 0 )
{
Editor.NewItemTypes = new List<Type>() { type.GetGenericArguments()[ 0 ] };
}
```
with the following :
```
else if( type.GetGenericArguments().Count() > 0 )
{
if( (propertyItem.DescriptorDefinition != null)
&& (propertyItem.DescriptorDefinition.NewItemTypes != null)
&& (propertyItem.DescriptorDefinition.NewItemTypes.Count > 0) )
{
Editor.NewItemTypes = propertyItem.DescriptorDefinition.NewItemTypes;
}
else
{
Editor.NewItemTypes = new List<Type>() { type.GetGenericArguments()[ 0 ] };
}
}
```