Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
microsoft.public.dotnet.framework.aspnet.buildingcontrols
TypeConverter for a generics list
Imar Spaanjaars
1/30/2008 7:52:00 PM
Hello everyone,
I am trying to write a TypeConverter for a property of type StringCollection
or List<string> that I want to persist as a comma separated value. E.g. in
markup I want to be able to use this:
<isp:SomeControl Value="1,2,3" runat="server" ID=MyControl" />
While in code, I want to be able to use something like:
MyControl.Value.Add(1);
Can anyone point me in the right direction on how to do this? I looked at
the StringArrayConverter in the WebControls namespace which seems close to
what I want to accomplish.
I tried different flavors of code involving ITypeDescriptorContext, various
CanConvert* methods etc but none seem to work so far. I either get no
results, or I get run-time errors.
In case anyone wants to give this a try, here's the code for the actual
control with the StringCollection property and the converter:
(Converter)
http://imar.spaan...
Downloads/Other/ServerControls/StringCollectionTypeCon...
(Control)
http://imar.spaan...
Downloads/Other/ServerControls/ModuleSe...
Any help would be greatly appreciated.
Regards,
Imar
http://imar.spaan...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
TypeConverter for a generics list
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password