473,396 Members | 1,725 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 2341
>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*******@discussions.microsoft.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*******@discussions.microsoft.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
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...
3
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"...
2
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...
0
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...
4
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...
4
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...
2
by: jbaldi | last post by:
I am trying to use a collection editor to edit multiple types as in the following example: ...
2
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...
4
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
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,...

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.