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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • news.zen.co.uk

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

    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


    Code frag as follows:

    Private Sub DataGridInvSumm ary_OnItemDataB ound(ByVal source As Object, ByVal
    e As System.Web.UI.W ebControls.Data GridItemEventAr gs) Handles
    DataGridInvSumm ary.ItemDataBou nd
    If e.Item.ItemType = ListItemType.It em Or e.Item.ItemType =
    ListItemType.Al ternatingItem Then
    Dim DataGridInvLine As New DataGrid

    Snipped...

    e.Item.Cells(2) .Controls.Add(D ataGridInvLine)
    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


  • Herfried K. Wagner [MVP]

    #2
    Re: ? Trapping events from a dyanamically created Datagrid - VB .NET.. DOH!

    "news.zen.co.uk " <fred@fred.co m> schrieb:[color=blue]
    > I now want to trap the ItemDataBound event for the dyanically created
    > DataGrid DataGridInvLine and can't seem to make it work...[/color]

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

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

    Comment

    Working...