Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > .NET 1.1: editor for custom collection

Reply
Thread Tools

.NET 1.1: editor for custom collection

 
 
Harlan Messinger
Guest
Posts: n/a
 
      08-03-2006
I have a web control (call it X) that inherits from Panel and that has
the following member data and property:

private System.Collections.ArrayList items =
new System.Collections.ArrayList();

[Category("Behavior"),
Editor(typeof(XYZ.Harlan.Editors.CollectionEditor) ,
typeof(ComponentEditor))]
public System.Collections.ArrayList Items
{
get { return items; }
}

The Items will be a collection of objects of type NavBarItem.

I've defined the CollectionEditor class in namespace XYZ.Harlan.Editors,
inheriting it from
System.Windows.Forms.Design.WindowsFormsComponentE ditor, and defining a
corresponding CollectionEditorPage, inherited from
System.Windows.Forms.Design.ComponentEditorPage

When I add an X control to a Web form, the Items properties shows up in
the property browser. Next to it, it reads "Collection", and it gives me
the "..." button to click to bring up an editor window. However, the
editor it's opening is the default "Object Collection Editor", just as
it does if I remove the Editor attribute from the definition of the
Items property.

What am I overlooking that is keeping my custom editor from being loaded?

Another question: if I wanted to use the default editor, how would I go
about it? Currently it thinks the item currently selected on the left is
nothing more than an Object, and only shows one property, Value, grayed
out on the right. How would I get it to treat an item as the NavBarItem
that it is, and show its properties, instead of as an Object? Or does it
not work this way?
 
Reply With Quote
 
 
 
 
Harlan Messinger
Guest
Posts: n/a
 
      08-03-2006
Never mind. An editor is for a whole component--and I had tried this
previously with a whole component and it worked, which is why I was
surprised this time. I think I was supposed to make a designer.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Collection problems (create Collection object, add data to collection, bind collection to datagrid) Řyvind Isaksen ASP .Net 1 05-18-2007 09:24 AM
Persisting collection data of a webcontrol when leaving the collection editor in VS2005 mehdi.mousavi@gmail.com ASP .Net Building Controls 1 05-19-2006 03:49 PM
Update Custom Collection that is bound to DataGrid made up of Custom COlumns Terry Holland ASP .Net Datagrid Control 9 10-28-2005 06:20 AM
ANN: New low-cost XML Editor, XSLT Editor, XSLT Debugger, DTD/Schema Editor Stylus Studio Java 0 08-03-2004 03:53 PM



Advertisments