Custom Server Control / Collection Property
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcontrolsvb' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Russ Nemhauser
Greetings,

I am creating a custom user control in a new Web Control Library project. My
control exposes one public readonly property called "Groups" which returns a
Collection.

This is really cool because when the user puts my control into his web form
in design time, he can see the "Groups" property in the properties window
and that little button with the three dots on it. When he clicks that it
brings up this really cool collection manager that lets you add items and
move them around & stuff.

The problem is, it is only letting him add "System.Object"s to this thing.
How can I get it to add the class that I created in my control so he can put
all the properties & stuff he needs in there? System.Object doesn't do me
any good!

Thanks in advance,
Russ

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.

Reply to this message...
 
    
Scott Guthrie (VIP)
You might want to take a look at the PerformanceMonitor control at:

http://www.asp.net/ControlGallery/ControlDetail.aspx?Control=3D43&tabinde=
x
=3D2

The source is shipped with the control -- and shows how to do something
very similar with a typed PerformanceCounterCollection (although the
control is written in C#).

Hope this helps,

Scott

-----Original Message-----
From: Russ Nemhauser [mailto:Click here to reveal e-mail address]=20
Sent: Saturday, April 06, 2002 5:42 PM
To: aspngcontrolsvb
Subject: [aspngcontrolsvb] Custom Server Control / Collection Property

Greetings,

I am creating a custom user control in a new Web Control Library
project. My=20
control exposes one public readonly property called "Groups" which
returns a=20
Collection.

This is really cool because when the user puts my control into his web
form=20
in design time, he can see the "Groups" property in the properties
window=20
and that little button with the three dots on it. When he clicks that it

brings up this really cool collection manager that lets you add items
and=20
move them around & stuff.

The problem is, it is only letting him add "System.Object"s to this
thing.=20
How can I get it to add the class that I created in my control so he can
put=20
all the properties & stuff he needs in there? System.Object doesn't do
me=20
any good!

Thanks in advance,
Russ

_________________________________________________________________
Get your FREE download of MSN Explorer at
http://explorer.msn.com/intl.asp.

| [aspngcontrolsvb] member Click here to reveal e-mail address =3D YOUR ID=20
| http://www.asplists.com/asplists/aspngcontrolsvb.asp =3D JOIN/QUIT=20
| http://www.asplists.com/search =3D SEARCH Archives

Reply to this message...
 
    
Alex Lowe
Of course you can always take the C# source and then run it through the
translator over at
(http://aspalliance.com/aldotnet/examples/translate.aspx). =)

Alex - AspFriends.com Moderation Team
Microsoft MVP - ASP.NET

***********************************************************
Have a question about using client side coding in your ASP.NET pages?
Send your question to [aspngclient]
(http://www.aspfriends.com/aspfriends/aspngclient.asp)
***********************************************************

[Original message clipped]

Reply to this message...
 
    
Russ Nemhauser
I think this is pointing me in the right direction, but in VB there appears
to be no such thing as "CollectionEditor" in the
System.ComponentModel.Design namespace. Can anyone shed some light?

Thanks,
Russ

[Original message clipped]

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx

Reply to this message...
 
 
System.ComponentModel.Design.CollectionEditor
System.Object




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com