String array property

BeppePix

Newcomer
Joined
Apr 21, 2005
Messages
3
Hi all,

in my class I declared a string-array property with the attributes to show it on PropertyGrid:

<CategoryAttribute("Aspect"), _
Browsable(True), _
DescriptionAttribute("Insert text"), _
XmlAttributeAttribute()> _
Property StringPointer() As String()
Get
Return m_StringList
End Get
Set(ByVal Value() As String)
Text = Value(0)
m_StringList = DirectCast(Value.Clone, String())
End Set
End Property

It works but the PropertyGrid allows to modify the strings in two ways:
1. through the default String Editor that appear clicking the StringPointer property on the Grid and
2. each single string if you expand the property clicking on the 'plus' symbol.


Now, because the whole array is the property, this last way doesn't reflect on the form that shows the strings.
Is there a way to simply prevent the second way?

Thanks for the attention.
 
I reply to myself, I think this will be useful...

I added a new attribute

<TypeConverter(GetType(CollectionConverter)), _

above the property definition and now there's just one way to modify the property by the PropertyGrid i.e. the string editor.
I don't know if this is the best solution but it works.

Any suggestion?
 
Back
Top