collectioneditor

Collection Editor at runtime

Hi, I'm working on an application to edit name/value pairs using a property grid. Some of the properties in my class file are ListDictionary collections. Is there an Editor attribute that I can apply at the property declaration that will make the Collection Editor work at runtime? If not, is it possible to inherit from ComponentMod...

PropertyGrid - Ilist Collection Remove not firing as expected

I have a collection object that implements IList. Inside the collection I have used a List to collect the items. Inside the PropertyGrid (at runtime), it binds properly and the Collection Editor opens. I can edit, and I can add items properly and I can catch these methods when they are used in the collection class. However, if you try t...

UserControl preview does not gets updated when existing items are deleted in CollectionEditor.

Hi All, I am facing this problem with default CollectionEditor. When I add items to the collection editor, I display the items as a rectangle on the user control. But when I delete the items that were present already the preview does not gets updated untill i click on OK or Add button. I have provided the code for the same below. Ste...

Webforms UserControl does not place items in the expected order when items in CollectionEditor moved up/down.

Hi all, This is another problem i found with CollectionEditor. If the order of the items in the CollectionEditor is important, (say im drawing the items on the UserControl preview from left to right) then moving the item up/down in the CollectionEditor does not update the preview. This is because the up/down buttons only change the i...

How to programmatically add items to CollectionEditor's list/listbox/collection ? [modified]

I have custom collection editor and I want to programmatically add items to it's list (collection) so they will could visible in a listbox. How I can do that? I know about CollectionEditor's AddItems method, but it takes collection object as a parameter, but I cannot figure out a way to get CollectionEditor's inner list object... :/ [up...

Design-time editor support for controls collection

I'd like to add a property which represents a collection of controls to a component and have a collection editor with which I can easily select the controls that belong to the collection. VS does almost what I want automatically with the following code: Private _controls As New List(Of Control) <DesignerSerializationVisibility(D...

PropertyGrid GenericList with GenericItems

Is there a way to display and edit values in the PropertyGrid (and his CollectionEditor) of an object, which is derived from an abstract generic class? I don't get the properties displayed only something like this: "IFilter´1" or "BaseFilter'1" Where IFilter is an Interface, and BaseFilter an abstract class. All objects contained by thi...

How to limit a PropertyGrid collection to a List<T>

Okay, I've read a couple of questions regarding the use of the PropertyGrid and collections. But, I'm having a difficult time understanding how/if [TypeConverter] will work for me. I've read the little blurb-age that MSDN puts out there, and frankly, it's a bit lacking to this poor, self-taught programmer. So, here is what I have. First...

Problem editing custom readonly collection in property grid, .net, winforms.

I have a custom collection, lets says COL, that derives from ObjectModel.Collection. I have my own collection editor that works fine when a property, of type COL, is Read and Write enabled. However, if I change the property to ReadOnly, the open editor button stops showing in the property grid. As a test, I override my custom editor wi...

Modifying CollectionEditor in PropertyGrid

I currently have a list containing Call's, which is the base class. If I want to add derived classes of Call to the list, I know to do the following. public class CustomCollectionEditor : System.ComponentModel.Design.CollectionEditor { private Type[] types; public CustomCollectionEditor(Type type) : base(type...

Questions about .NET CollectionEditor type

Who can tell me the internal working mechanism of a CollectionEditor in plain English? I have implemented every virtual function and step into each of them. Still got no clue of its intended algorithm. I searched the web and found tons of compaints about the CollectionEditor type, and even bugs. I am kind of thinking of the Collection...

CollectionEditor leads to "Object does not match target type."

I have a custom control which has a property of type Collection< System.Drawing.Point >. When I use CollectionEditor to edit this property, the CollectionEditor window shows "Object does not match target type." for the "X" and "Y" properties. But if I use System.Drawing.PointF instead, there's no failure. Could anyone tell me why? ...

How to add validation to PropertyGrid's CollectionEditor?

I'm using PropertyGrid to edit an object containing a collection. Collection is edited using the CollectionEditor. I have to make sure elements in collection are unique. How can I add validation to CollectionEditor: By either overloading CollectionEditor's OnFormClosing Or adding validation for creating/editing items? ...

Property setter not getting called with CollectionEditor

I have a custom control that has an Items property. I Have applied an EditorAttribute with a UITypeEditor of type CollectionEditor. Collection Type: [Serializable] [Editor(typeof(CollectionEditor), typeof(UITypeEditor))] public class ListItemsCollection : CollectionBase { // methods } Property Declaration In The Control: pri...

Is there any way to use a CollectionEditor outside of the property grid?

I'm replacing my property grid with something that will allow me to customize my UI a bit better. I placed a button on my form that I hope when clicked would pop up a CollectionEditor and allow me to modify my code. When I was using the PropertyGrid, all I needed to do was add some attributes to the property pointing to my CollectionEd...