The string ‘(Collection)’ is coming from the TypeConverter on that property, which is CollectionConverter. To modify this value, do the following…
[TypeConverter(typeof(MyCollectionConverter)]
public class MyCollection : SomeBaseCollectoin
{
// ...
}
internal class MyCollectoinConverter : System.ComponentModel.CollectionConverter
{
public override object ConvertTo(ITypeDescriptorContext context,
CultureInfo culture, object value, Type destinationType)
{
if (destinationType == typeof(string))
{
if (value is ICollection)
{
return 'You can return what ever string value you want
here';
}
}
return base.ConvertTo(context, culture, value, destinationType);
}
}
(from sburke_online@microsoft..nospam..com on microsoft.public.dotnet.framework.windowsforms)
Share with