Inherit from Table, net Catching child butten event

A

a serr

I'm creating a custom control Inheriting from Table and implementing
INamingContainer that has a button added to a TableCell.
( public class SmartDataTable : Control, INamingContainer
{
protected override void CreateChildControls( )
{
TableCell myCell = new TableCell();
myCell.Controls.Add(myBtn)
this.MyBtn.Click += new
EventHandler(this.OnMyBtn_Click);
TableRow myRow = new TableRow();
myRow.Cells.Add(myCell);
Rows.Add(myRow);
} )
The button posts the form back to the server, but I cannot seem to catch the
event in my CustomTable control.

The other option I have found is to inherit from Control (making a composite
control) but the how do I get my control to have all of the properties of the
Table at the top level?
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top