templated control designers and default controls

Discussion in 'ASP .Net Building Controls' started by Rick, Oct 1, 2004.

  1. Rick

    Rick Guest

    I'm trying to develop a designer that will allow a developer to drag and
    drop a control onto the design surface and right click it to edit two
    templates, the two templates being panels for other controls to be
    dropped onto. This all works fine but what I really want to have is a
    set of default controls already in the panels (couple of labels,
    textboxes, that sort of thing) when the templates are edited. Is there
    any way of adding default controls in this way at design time ? I'm
    gradually coming to the conclusion that it can't be done !

    Furthermore, if I do somehow manage to get a set of default controls to
    appear, is it possible to make these read only whereas any other
    controls dropped into the panel would be read/write ? From what I've
    read so far it would appear that this is not currently possible, can
    anyone confirm this ?

    Any help/advice most gratefully received.

    Dr Richard Edwards, .NET Developer
    Rick, Oct 1, 2004
    1. Advertisements

  2. At run time, you can create a default template by instantiating a class
    which implements ITemplate and using it to set your template property. It
    would be interesting to see if that works at design time at all.
    John Saunders, Oct 1, 2004
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.