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

L

Lenny

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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top