Creating a custom control (ascx) with 'child' classes

Discussion in 'ASP .Net' started by Lenny, Sep 4, 2003.

  1. Lenny

    Lenny Guest

    Hello,

    I have an html table template which I want to turn into ASP.NET custom
    control. I want to utilize the best features of OOP. I want to be able to
    create columns headings dynamically, add buttons to the footer of the table,
    etc. A datagrid control wont work for me, because I want to have custom
    buttons images for paging and sorting.
    Here is one thing I have the most difficulty with:

    I need a way to have a "master" custom table tag and then "child" columns
    tags. The same concept as datagrid:

    <asp:DataGrid id="myDataGrid" runat="server">
    <Columns>
    <asp:BoundColumn DataField="ProductName" HeaderText="Product
    Name"></asp:BoundColumn>
    <asp:BoundColumn DataField="UnitPrice" HeaderText="Unit
    Price"></asp:BoundColumn>
    <asp:BoundColumn DataField="UnitsInStock" HeaderText="Stock
    Level"></asp:BoundColumn>
    </Columns>
    </asp:DataGrid>

    So my custom controls would look something like:

    <myCustomC:myData id="myDataTable" runat="server">
    <myCustomC:column heading="Product Name" color="red"></myCustomC:column>
    <myCustomC:column heading="UnitPrice" color="red"></myCustomC:column>
    </myCustomC:myData>

    Any ideas?

    Thank you
     
    Lenny, Sep 4, 2003
    #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. Jeff Rodriguez
    Replies:
    23
    Views:
    1,134
    David Schwartz
    Dec 9, 2003
  2. Lenny

    Creating a custom control (ascx) with 'child' classes

    Lenny, Sep 4, 2003, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    165
    Lenny
    Sep 4, 2003
  3. Lenny

    Creating a custom control (ascx) with 'child' classes

    Lenny, Sep 4, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    127
    Lenny
    Sep 4, 2003
  4. Lenny

    Creating a custom control (ascx) with 'child' classes

    Lenny, Sep 4, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    121
    Lenny
    Sep 4, 2003
  5. Joe
    Replies:
    1
    Views:
    375
    Jeffrey Tan[MSFT]
    Feb 16, 2004
Loading...

Share This Page