String Collection Property Editor

S

Shimon Sim

I have control. One of the properties is implemented as StringCollection. I
didn't use any Editor attribute for it.
During Design time system shows dialog similar to Items in DropDownList but
Add button throws an error "Constructor on type System.String not found.". I
may understand this message - there are too many contractor and non of them
takes string. But how can I fix the problem or may be use the editor similar
to Font.Names collection.
Thank you
Shimon.
 
S

Steven Cheng[MSFT]

Hi Shimon,

Welcome to ASPNET newsgroup.
As for the problem with Editing StringCollection property in asp.net
webcontrol at design-time, it seems a known issue which is described in the
following blog article:

#StringCollectionEditor
http://blogs.msdn.com/toub/archive/2004/10/12/241277.aspx

However, based on my research, though we can make the design-time editing
work, the ASP.NET runtime can not correctly parse the StringCollection's
perisstent content (which is different from winform ). So generally I'd
recommend that we define our custom class to wrapper the string value and
then define a Custom Collection based class to replace the
StringCollection. And we can define property of the custom collection class
for our custom control. Below is another community member's demo webcontrol
which contains complete demonstration on developing a rich design-time
support webcontrol:

#rich custom webcontrol sample
http://www.dalepreston.com/Blog/2005/07/visually-add-client-scripts-to-your.
html

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "Shimon Sim" <[email protected]>
| Subject: String Collection Property Editor
| Date: Wed, 3 Aug 2005 09:06:25 -0400
| Lines: 11
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: ool-44c05922.dyn.optonline.net 68.192.89.34
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:115842
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| I have control. One of the properties is implemented as StringCollection.
I
| didn't use any Editor attribute for it.
| During Design time system shows dialog similar to Items in DropDownList
but
| Add button throws an error "Constructor on type System.String not
found.". I
| may understand this message - there are too many contractor and non of
them
| takes string. But how can I fix the problem or may be use the editor
similar
| to Font.Names collection.
| Thank you
| Shimon.
|
|
|
 
S

Shimon Sim

Thank you Steven. I already rewrote my code the way you described.
Thank you for links.
Shimon.
 
S

Steven Cheng[MSFT]

You're welcome Shimon :)

Good luck!


Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| From: "Shimon Sim" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: String Collection Property Editor
| Date: Thu, 4 Aug 2005 06:19:57 -0400
| Lines: 81
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: ool-44c05922.dyn.optonline.net 68.192.89.34
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP14.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:116062
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thank you Steven. I already rewrote my code the way you described.
| Thank you for links.
| Shimon.
| | > Hi Shimon,
| >
| > Welcome to ASPNET newsgroup.
| > As for the problem with Editing StringCollection property in asp.net
| > webcontrol at design-time, it seems a known issue which is described in
| > the
| > following blog article:
| >
| > #StringCollectionEditor
| > http://blogs.msdn.com/toub/archive/2004/10/12/241277.aspx
| >
| > However, based on my research, though we can make the design-time
editing
| > work, the ASP.NET runtime can not correctly parse the StringCollection's
| > perisstent content (which is different from winform ). So generally I'd
| > recommend that we define our custom class to wrapper the string value
and
| > then define a Custom Collection based class to replace the
| > StringCollection. And we can define property of the custom collection
| > class
| > for our custom control. Below is another community member's demo
| > webcontrol
| > which contains complete demonstration on developing a rich design-time
| > support webcontrol:
| >
| > #rich custom webcontrol sample
| >
http://www.dalepreston.com/Blog/2005/07/visually-add-client-scripts-to-your.
| > html
| >
| > Hope helps. Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| > --------------------
| > | From: "Shimon Sim" <[email protected]>
| > | Subject: String Collection Property Editor
| > | Date: Wed, 3 Aug 2005 09:06:25 -0400
| > | Lines: 11
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| > | X-RFC2646: Format=Flowed; Original
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet
| > | NNTP-Posting-Host: ool-44c05922.dyn.optonline.net 68.192.89.34
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet:115842
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| > |
| > | I have control. One of the properties is implemented as
| > StringCollection.
| > I
| > | didn't use any Editor attribute for it.
| > | During Design time system shows dialog similar to Items in
DropDownList
| > but
| > | Add button throws an error "Constructor on type System.String not
| > found.". I
| > | may understand this message - there are too many contractor and non of
| > them
| > | takes string. But how can I fix the problem or may be use the editor
| > similar
| > | to Font.Names collection.
| > | Thank you
| > | Shimon.
| > |
| > |
| > |
| >
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top