473,566 Members | 2,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Object Collection Editor

Hi all,

Is there any information to be had about the "Object
Collection Editor" that appears when you click on a
collection property in the PropertyGrid control? I have a
class that maintains a collection of instances of the same
class, and I would like the user to be able to expand the
nested instances and view their properties.

For example, if I have a class called TestClass that has
three properties: Name, ID, and Children, with Children
being a collection of TestClass instances, is there a way
I can use the PropertyGrid to allow the user to "drill
down" into the properties of the child-collection
instances? The Object Collection Editor seems to represent
each member of a collection simply by calling the object's
ToString() method, so I can only go one level deep. The
PropertyGrid itself will expand nested properties as many
levels down as one likes, but the problem is that the
child collection is created at runtime, so I need to use
an ArrayList. Any thoughts?

Thanks, Malcolm

Jul 21 '05 #1
4 2371
>but the problem is that the
child collection is created at runtime, so I need to use
an ArrayList. Any thoughts?

Why do you need an ArrayList at runtime, couldn't you for example use a
strongly type collection? By doing so, the collection editor will know what
type of objects you want to put in the collection so it will be able to
generate a UI for it.

--
Greetz,
Jan
_______________ _______________ ____
Read my weblog: http://weblogs.asp.net/jan
"m. pollack." <an*******@disc ussions.microso ft.com> schreef in bericht
news:02******** *************** *****@phx.gbl.. . Hi all,

Is there any information to be had about the "Object
Collection Editor" that appears when you click on a
collection property in the PropertyGrid control? I have a
class that maintains a collection of instances of the same
class, and I would like the user to be able to expand the
nested instances and view their properties.

For example, if I have a class called TestClass that has
three properties: Name, ID, and Children, with Children
being a collection of TestClass instances, is there a way
I can use the PropertyGrid to allow the user to "drill
down" into the properties of the child-collection
instances? The Object Collection Editor seems to represent
each member of a collection simply by calling the object's
ToString() method, so I can only go one level deep. The
PropertyGrid itself will expand nested properties as many
levels down as one likes, but the problem is that the
child collection is created at runtime, so I need to use
an ArrayList. Any thoughts?

Thanks, Malcolm

Jul 21 '05 #2
Hi Jan,

A good thought! Will the Object Collection Editor in fact
be smart enough to display object properties for members
of a strongly typed collection? That's why I was looking
for some documentation about the editor itself. I suppose
I'll just go ahead and try it. Thanks!

malcolm

Jul 21 '05 #3

Jan,

That did it! thanks again... MP
Jul 21 '05 #4
Glad I could help!

--
Greetz,
Jan
_______________ _______________ ____
Read my weblog: http://weblogs.asp.net/jan
"m. pollack" <an*******@disc ussions.microso ft.com> schreef in bericht
news:06******** *************** *****@phx.gbl.. .

Jan,

That did it! thanks again... MP

Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2502
by: Edward Diener | last post by:
In C++ an overridden virtual function in a derived class must have the exact same signature of the function which is overridden in the base class, except for the return type which may return a pointer or reference to a derived type of the base class's return type. In .NET the overridden virtual function is similar, but an actual parameter...
3
2724
by: Nak | last post by:
Hi there, I am trying to make a collection that will work in the "Object collection editor" dialog. I have implimeneted ICollection, IList and IEnumerable and now I have an "unnamed" collection, so the collection just contains "objects". I would like it to contain my own objects "myItem" so that I can edit the individual properties via...
2
4057
by: Marco de Vries | last post by:
I have a user control and I want to add some properties in design time using a Colelction editor. I defined a type and collection for example. Public Class TestDefinition ... properties get/set End Class Public Class TestCollection inherits collectionbase
0
879
by: sam | last post by:
Hi I'm having trouble with get the collection editor to show my collection in designer. Have included what I think is the relevant code below. When I click on the AvailableLogLevels in designer, it show 4 members (which is correct) but each is called Messages.MessageBox+LogLevel and has a value of the same. What I had hoped for was 4...
4
2498
by: Michael | last post by:
Dear all .. If I want to use develop a user control and declare a public property which the type is System.Windows.Forms.GridTableStylesCollection For example : Public Class LookAndView Inherits System.Windows.Forms.UserControl Private _Collection As GridTableStylesCollection
4
341
by: m. pollack. | last post by:
Hi all, Is there any information to be had about the "Object Collection Editor" that appears when you click on a collection property in the PropertyGrid control? I have a class that maintains a collection of instances of the same class, and I would like the user to be able to expand the nested instances and view their properties. For...
2
6753
by: jbaldi | last post by:
I am trying to use a collection editor to edit multiple types as in the following example: http://windowsforms.com/blogs/faqs/archive/2006/05/26/how-do-i-allow-a-user-to-add-more-than-one-type-of-object-to-a-collection-at-design-time.aspx The problem I am having is with the property grid. I can add multiple types to my collection editor...
2
12486
by: ME | last post by:
I have a property that is a generic list of type IAddress (List<IAddress>). When I attempt to view this property using the Property Grid control it plainly says "Collection" and offers the typical generic CollectionEditor that ships with .NET to edit the property. The trouble comes up though when I attempt to Add an item to the collection via...
4
5439
by: Rohan | last post by:
I need to use the Collection editor of the propertyGrid, but i can't this to work, i looked around on the NET on collection and I am kinda lost. i have this so far, i don't know what i should do next Thank you Public class frmColor Dim xColors As New myColors
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7644
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7951
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2083
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.