473,387 Members | 1,485 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,387 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 2340
>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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.