Collections properties in custom controls - 04-17-2006 , 03:57 PM
Hi, How I can create collections properties in my custom controls in ASP.net
(C#), I need create properties inside other propierties. Thanks! My english
is bad, excuse me!
Re: Collections properties in custom controls - 04-18-2006 , 06:14 PM
Apparently this is not possible with UserControls (well, you can, but they
can't be edited via the Property Editor in the Designer). For Custom
Controls (derived or composite) you can try decorating your collection
property as so:
<DesignerSerializationVisibility(DesignerSerializa tionVisibility.Content), _
Public ReadOnly Property MyItems() As ...
And pray a little.
P.S. Custom controls (Derived, Composite, or User) ABSOLUTELY SUCK in
"Roberto Ferreira" <fpontes (AT) cantv (DOT) net> wrote
Re: Collections properties in custom controls - 04-19-2006 , 04:01 AM
hi roberto, first you need to create your collection class, this will be the
type of your property in your custom control. If you need to know how to
define a collection class, take a look at the following documentation on
Once you have this defined, make a public property in your custom control
with a getter accessor only. No setter =P
Ok, another thing i'm not clear with is when you say property of a property
? It seems to me you do not want a collection property but a property with a
complex type. If this is the case then instead of a collection class you can
have a normal class and this will be the type of your property.
A good, full working example for collection properties is also available on
msdn articles, take a look :
Even though this one uses an arraylist(simplicity at its best), its a good
example and gives you a good idea on how to proceed.
If you are still confused, feel free to ask.
Have a good day,
"CMM" <cmm (AT) nospam (DOT) com> ha scritto nel messaggio
news:%23tbw$VzYGHA.3880 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
Re: Collections properties in custom controls - 04-21-2006 , 10:29 AM
Thanks for all.. I'll read the page after.
"Alessandro Zifiglio" <AlessandroZifiglio @ -h-o-t-m-a-i-l-c-o-m> escribió en el mensaje news:OeWqEe4YGHA.3880 (AT) TK2MSFTNGP04 (DOT) phx.gbl...
|Thread Tools||Search this Thread|