Problem with ControlDesigner and GetDesignTimeHtml

Discussion in 'ASP .Net Web Controls' started by Nicolas LeBlanc, Jul 29, 2004.

  1. Hello,

    I'm trying to do a control that does an html table around other controls, it
    works 100% fine, but I have decided to implement design time viewing, now
    I'm in trouble.

    It works, but it does not render any nested controls inside my control
    (which inherits from a Panel), so no child controls are rendered in design
    time at all.

    Of course, if I don't use a designer, I have the standard Panel behavior,
    but this is not what I want, I want to see my html table rendered and the
    content inside the panel rendered too.

    There are very few examples on the web, and I have yet to see anybody doing
    a GetDesignTimeHtml method that, for exemple, render a datagrid inside it...

    Can anybody help? This is not really needed, but design time viewing is
    pretty useful.

    Thanks.
     
    Nicolas LeBlanc, Jul 29, 2004
    #1
    1. Advertising

  2. Nicolas LeBlanc

    Dale Guest

    You can use the DataGridDesigner class to provide functionality similar to
    the default designer action in Visual Studio.

    If you just want to render a simulation of a DataGrid, you should emulate
    the HTML that is rendered to the browser by ASP.NET. Something I do is to
    open the source view of the control as rendered in a browser, and then wrap
    the rendered HTML in a StringBuilder or TextWriter to collect the HTML and
    return it as the result of the GetDesignTimeHtml.

    You can use the GetDesignTimeDataSource to return a collection that can be
    used to provide designtime data for your datagrid.


    Dale Preston
    MCAD, MCSE, MCDBA

    "Nicolas LeBlanc" <> wrote in message
    news:...
    > Hello,
    >
    > I'm trying to do a control that does an html table around other controls,

    it
    > works 100% fine, but I have decided to implement design time viewing, now
    > I'm in trouble.
    >
    > It works, but it does not render any nested controls inside my control
    > (which inherits from a Panel), so no child controls are rendered in design
    > time at all.
    >
    > Of course, if I don't use a designer, I have the standard Panel behavior,
    > but this is not what I want, I want to see my html table rendered and the
    > content inside the panel rendered too.
    >
    > There are very few examples on the web, and I have yet to see anybody

    doing
    > a GetDesignTimeHtml method that, for exemple, render a datagrid inside

    it...
    >
    > Can anybody help? This is not really needed, but design time viewing is
    > pretty useful.
    >
    > Thanks.
    >
    >
     
    Dale, Jul 30, 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. =?Utf-8?B?S0NT?=
    Replies:
    0
    Views:
    483
    =?Utf-8?B?S0NT?=
    Sep 22, 2005
  2. Joshua Flanagan

    Force new call to GetDesignTimeHtml

    Joshua Flanagan, Jan 4, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    584
    Joshua Flanagan
    Jan 4, 2006
  3. Vincent Scheel
    Replies:
    0
    Views:
    427
    Vincent Scheel
    Mar 20, 2006
  4. Steve Wesorick

    GetDesignTimeHTML doesn't fire for PanelDesigner.

    Steve Wesorick, Jan 27, 2004, in forum: ASP .Net Building Controls
    Replies:
    3
    Views:
    149
    Steve Wesorick
    Jan 28, 2004
  5. Luciano Bargmann

    GetDesignTimeHtml() is never called in ReadWriteControlDesigner

    Luciano Bargmann, Sep 14, 2005, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    138
    n1patrick
    Sep 16, 2005
Loading...

Share This Page