.NET 1.1: editor for custom collection

Discussion in 'ASP .Net Web Controls' started by Harlan Messinger, Aug 3, 2006.

  1. 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.WindowsFormsComponentEditor, 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?
    Harlan Messinger, Aug 3, 2006
    #1
    1. Advertising

  2. 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.
    Harlan Messinger, Aug 3, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stylus Studio
    Replies:
    0
    Views:
    633
    Stylus Studio
    Aug 3, 2004
  2. Øyvind Isaksen
    Replies:
    1
    Views:
    946
    Øyvind Isaksen
    May 18, 2007
  3. Replies:
    1
    Views:
    274
    Tim Dot NoSpam
    May 19, 2006
  4. Terry Holland
    Replies:
    9
    Views:
    202
    Steven Cheng[MSFT]
    Oct 28, 2005
  5. Donald Simpson

    Web Custom Control & Custom Collection problem

    Donald Simpson, Jul 11, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    122
    Donald Simpson
    Jul 11, 2003
Loading...

Share This Page