Object Collection Editor

Discussion in 'ASP .Net Building Controls' started by Sergio Florez M., Dec 3, 2004.

  1. I created a button control that I'll call MyButton. I also created a
    composite control that will have among other things a toolbar composed of
    MyButtons. Let's call this control MyCompositeControl. I want the
    MyCompositeControl to have a Buttons property that will be a MyButton
    collection. I created a MyButtonsCollection inheriting from CollectionBase
    and implementing IEnumerable. The Buttons property in MyCompositeControl is
    a MyButtonsCollection.

    My control already admits Buttons and this is more or less how it all looks
    in the aspx:

    <xxx:MyCompositeControl id="MyCompositeControl1" runat="server>
    <Buttons>
    <xxx:MyButton ID="MyButton1" SomeProperty="111"></xxx:MyButton>
    <xxx:MyButton ID="MyButton2" SomeProperty="222"></xxx:MyButton>
    <xxx:MyButton ID="MyButton3" SomeProperty="333"></xxx:MyButton>
    </Buttons>
    </xxx:MyCompositeControl>

    What do I have to do to get the Object Collection Editor that opens up when
    I click the "..." button that shows up in the properties pane for the
    Buttons property to add MyButton objects to it?

    One other question, MyCompositeControl look fine in design time until I
    start with the <Buttons> tag, once I start adding buttons I get "Error
    creating control" in the designer. How do I fix this?

    The functionality of the control is all up and running, these are just
    designer issues that I want to comprehend.

    Is any of this understandable at all?

    --
    Sergio Florez M.
    Medellín, Colombia.
     
    Sergio Florez M., Dec 3, 2004
    #1
    1. Advertising

  2. Sergio Florez M.

    Paul K Guest

    As far as the Buttons property, I have done similar projects and never had to
    do anything special. The standard collection editor opens when I clicked on
    the ellipses and I am able to add objects without a problem. Are you seeing
    the ellipses in the property grid?

    As far as the problem rendering the control, it might be how you are
    rendering the control when it has buttons in it -- if you use the
    RenderControl method in your designer you'll have to make sure you wrap any
    references to runtime-only objects (such as Page) in if blocks to make sure
    you're not trying to use an object that doesn't exist.

    What I normally do is just be an exception handler in the designer and
    output the stack trace. This can narrow the problem down pretty quickly.

    "Sergio Florez M." wrote:

    > I created a button control that I'll call MyButton. I also created a
    > composite control that will have among other things a toolbar composed of
    > MyButtons. Let's call this control MyCompositeControl. I want the
    > MyCompositeControl to have a Buttons property that will be a MyButton
    > collection. I created a MyButtonsCollection inheriting from CollectionBase
    > and implementing IEnumerable. The Buttons property in MyCompositeControl is
    > a MyButtonsCollection.
    >
    > My control already admits Buttons and this is more or less how it all looks
    > in the aspx:
    >
    > <xxx:MyCompositeControl id="MyCompositeControl1" runat="server>
    > <Buttons>
    > <xxx:MyButton ID="MyButton1" SomeProperty="111"></xxx:MyButton>
    > <xxx:MyButton ID="MyButton2" SomeProperty="222"></xxx:MyButton>
    > <xxx:MyButton ID="MyButton3" SomeProperty="333"></xxx:MyButton>
    > </Buttons>
    > </xxx:MyCompositeControl>
    >
    > What do I have to do to get the Object Collection Editor that opens up when
    > I click the "..." button that shows up in the properties pane for the
    > Buttons property to add MyButton objects to it?
    >
    > One other question, MyCompositeControl look fine in design time until I
    > start with the <Buttons> tag, once I start adding buttons I get "Error
    > creating control" in the designer. How do I fix this?
    >
    > The functionality of the control is all up and running, these are just
    > designer issues that I want to comprehend.
    >
    > Is any of this understandable at all?
    >
    > --
    > Sergio Florez M.
    > Medellín, Colombia.
    >
    >
    >
    >
     
    Paul K, Dec 8, 2004
    #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:
    699
    Stylus Studio
    Aug 3, 2004
  2. Øyvind Isaksen
    Replies:
    1
    Views:
    987
    Øyvind Isaksen
    May 18, 2007
  3. Nathan Phelps

    CollectionEditor is always "Object Collection Editor"

    Nathan Phelps, May 4, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    191
    Nathan Phelps
    May 8, 2004
  4. Replies:
    1
    Views:
    298
    Tim Dot NoSpam
    May 19, 2006
  5. Daniel Jorge
    Replies:
    1
    Views:
    195
Loading...

Share This Page