Rendering DataGrid in a custom control at design time

Discussion in 'ASP .Net Datagrid Control' started by Sam Fields, Jan 15, 2004.

  1. Sam Fields

    Sam Fields Guest

    I have built custom controls that inherit from the HtmlTable control so that
    they will render properly at design time. I am using a designer, since for
    some reason an Html control without a designer gives ID problems. My
    designer is simple:

    internal class StandardHtmlControlDesigner : ControlDesigner
    {
    public override string GetDesignTimeHtml()
    {
    return base.GetDesignTimeHtml();
    }
    }

    This works very well. Also, when building the inherited controls
    themselves, I am using the following directives:

    [Designer(typeof(Design.StandardHtmlControlDesigner), typeof(IDesigner))]
    [PersistChildren(false)]
    [PersistenceMode(PersistenceMode.InnerDefaultProperty)]
    [ParseChildren(true)]

    So that it will properly parse and render the children with the custom table
    is rendered. This renders every control correctly, EXCEPT the datagrid
    control. I want to use the .NET <asp:DataGrid>, but for some reason the
    CreateControlHierarchy(false) is never called during the rendering of the
    datagrid. The is not affecting the browser output, I just want it to render
    at design time properly with the columns filled out like a default DataGrid
    control would be (with 5 rows, and "DataBound" rendered in the databound
    columns).

    Can anyone tell me how to hook into the DataGrid control (I'm assuming via
    my designer) to tell it to create the non-bound control hierarchy?

    Thanks!
    Sam Fields
    Sam Fields, Jan 15, 2004
    #1
    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. Replies:
    0
    Views:
    707
  2. Barry Carr
    Replies:
    4
    Views:
    780
    Barry Carr
    Jan 15, 2004
  3. Sam Fields

    Rendering DataGrid in a custom control at design time

    Sam Fields, Jan 15, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    137
    Sam Fields
    Jan 15, 2004
  4. Joey Lee

    Rendering Custom Control during design time

    Joey Lee, Jun 30, 2005, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    146
    Joey Lee
    Jul 1, 2005
  5. Sam Fields

    Rendering DataGrid in a custom control at design time

    Sam Fields, Jan 15, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    117
    Sam Fields
    Jan 15, 2004
Loading...

Share This Page