Inherit from Table, net Catching child butten event

Discussion in 'ASP .Net Building Controls' started by a serr, Apr 22, 2005.

  1. a serr

    a serr Guest

    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?

    --
    A. Serr
     
    a serr, Apr 22, 2005
    #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. Lars Netzel
    Replies:
    3
    Views:
    448
    Greg Burns
    Jul 22, 2004
  2. Jeff Rodriguez
    Replies:
    23
    Views:
    1,157
    David Schwartz
    Dec 9, 2003
  3. Andrew

    Custom Control - inherit child properties?

    Andrew, Jul 16, 2003, in forum: ASP .Net Building Controls
    Replies:
    6
    Views:
    190
    Andrew
    Jul 17, 2003
  4. caldera

    Placeholder child of child control event problem.

    caldera, May 27, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    218
  5. Michael Ahrens

    Butten Event not fired ASP.NET 2.0 VS 2008

    Michael Ahrens, Mar 27, 2009, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    817
    Michael Ahrens
    Apr 2, 2009
Loading...

Share This Page