By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,507 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

Another custom property question

P: n/a
I have added a property of custom class type to a control. I can see and set
the property at design time, but nothing is saved.
I have added many other properties of defined types like string, boolean,
etc. And these all work fine.

Here is a sample of my property code...

<Category( "MyProperty" ) > _
Public Property DumbProperty( ) as MyCollection
Get
return some_MyCollection_Object
End Get
Set (ByVal Value as MyCollection )
some_MyCollection_Object = Value
End Set
End Property
What am I missing here? Any ideas or suggestions would be appreciated.
Jul 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I think you need to add DesignerSerializationVisibility attribute, with the
value Visible.

This is because, this is a collection, and needs to be serialized
differently. The designer needs to generate something like:

myObject.DumpProperty.Add(new MyItem())

"cOdEmOnKeY" <cO********@discussions.microsoft.com> wrote in message
news:0E**********************************@microsof t.com...
I have added a property of custom class type to a control. I can see and set the property at design time, but nothing is saved.
I have added many other properties of defined types like string, boolean,
etc. And these all work fine.

Here is a sample of my property code...

<Category( "MyProperty" ) > _
Public Property DumbProperty( ) as MyCollection
Get
return some_MyCollection_Object
End Get
Set (ByVal Value as MyCollection )
some_MyCollection_Object = Value
End Set
End Property
What am I missing here? Any ideas or suggestions would be appreciated.

Jul 21 '05 #2

P: n/a
If I am not mistaken, the designer does not know what your type is, as
it only knows the default types of the .net classes. As a solution, you
should create a type converter. More info:
http://msdn.microsoft.com/library/de...imesupport.asp

Michel van den Berg

cOdEmOnKeY wrote:
I have added a property of custom class type to a control. I can see and set
the property at design time, but nothing is saved.
I have added many other properties of defined types like string, boolean,
etc. And these all work fine.

Here is a sample of my property code...

<Category( "MyProperty" ) > _
Public Property DumbProperty( ) as MyCollection
Get
return some_MyCollection_Object
End Get
Set (ByVal Value as MyCollection )
some_MyCollection_Object = Value
End Set
End Property
What am I missing here? Any ideas or suggestions would be appreciated.

Jul 21 '05 #3

P: n/a
Thank you for your replies...
I think that will get me going in the right direction.

Thanks

"cOdEmOnKeY" wrote:
I have added a property of custom class type to a control. I can see and set
the property at design time, but nothing is saved.
I have added many other properties of defined types like string, boolean,
etc. And these all work fine.

Here is a sample of my property code...

<Category( "MyProperty" ) > _
Public Property DumbProperty( ) as MyCollection
Get
return some_MyCollection_Object
End Get
Set (ByVal Value as MyCollection )
some_MyCollection_Object = Value
End Set
End Property
What am I missing here? Any ideas or suggestions would be appreciated.

Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.