Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Child Controls and Event Handlers

Thread Tools

Child Controls and Event Handlers

Posts: n/a
I have a web form containing 2 design time controls, a
datagrid (myDatagrid) and a Table (myTable). At runtime I
bind the Datagrid to a dataset. I also loop through an
additional dataset and add columns to the table, each
column contains a LinkButton. I attach an event handler
do the LinkButtons using the following command.

theLinkButton.Command += new CommandEventHandler

If I run the page like I've just described everything
works fine. When I click the HyperText of the LinkButton
the DoPostBack command triggers and passes back whatever
it passes back and the My_command function is called.

Here is the problem I'm having: For my DataGrid, I've
attached a function to the OnItemDataBound event which
fires for each row as it is bound to the Dataset. Based
on a specific value in one of the datagrid cells, I
attach myTable to the specific cell using the following


Visually this is working, myTable no longer appears on
the main page but is now in the cell I've attached it to.
The problem is the MyCommand event is no longer triggered
when I click on the Hyperlink for the LinkButton. I can
see that there is a difference between the __doPostBack()
javascript function but I do not understand how to
overcome the problem.

Can anyone help me understand what I need to do to get
the Event handler working when the myTable object is
attached as a child object to myDataGrid.

Thanks for your help,
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Event handlers and dynamically created controls =?Utf-8?B?TWlrZSBSYW5k?= ASP .Net 2 01-26-2007 08:31 PM
HELP! Child controls of child controls not visible to web app ASP .Net Building Controls 0 05-05-2005 09:14 PM
Write web controls out to a page and associating event handlers =?Utf-8?B?Tm92aWNl?= ASP .Net 1 09-23-2004 06:31 PM
How do I: Main thread spawn child threads, which child processes...control those child processes? Jeff Rodriguez C Programming 23 12-09-2003 11:06 PM
RaisePostBackEvent and Web Controls Event Handlers Lucas Tam ASP .Net Building Controls 1 08-31-2003 05:03 PM