? Trapping events from a dyanamically created Datagrid - VB .NET.. DOH!

  • Thread starter Thread starter news.zen.co.uk
  • Start date Start date
N

news.zen.co.uk

Hi Guys,

Am putting together a WEB App with an ever nearing deadline :o( I've a
Master Datagrid (defined in the ASP page) containing in the second column a
(details) datagrid (dynamically generated with the ItemDataBound event for
the master). Got the basic code from the excellent article
http://www.dotnetjunkies.com/Tutorial/47792CB0-0990-4BD8-BF84-B6063C4C9BBC.dcik

Code frag as follows:

Private Sub DataGridInvSummary_OnItemDataBound(ByVal source As Object, ByVal
e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGridInvSummary.ItemDataBound
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType =
ListItemType.AlternatingItem Then
Dim DataGridInvLine As New DataGrid

Snipped...

e.Item.Cells(2).Controls.Add(DataGridInvLine)
End If
End Sub

I now want to trap the ItemDataBound event for the dyanically created
DataGrid DataGridInvLine and can't seem to make it work... all help really
really appreciated :o)

Thanks for taking the time to read this...

Shaun
 
news.zen.co.uk said:
I now want to trap the ItemDataBound event for the dyanically created
DataGrid DataGridInvLine and can't seem to make it work...

Take a look at the documentation on the 'AddHandler' and 'RemoveHandler'
statements.
 
Back
Top