title: Click event is not firing of dynamically added link button in grid view
body: <p>I am writing the following code on the rowdatabound of the grid view and i am not getting the click event of link button</p>
  
  <pre><code>Protected Sub CoolGRDSourcedDetails_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles CoolGRDSourcedDetails.RowDataBound
          Dim iLoop As Integer
          Dim lbtnCountDetails As New LinkButton
          e.Row.Cells.RemoveAt(1)
          If e.Row.RowType = DataControlRowType.Header Then
              For iLoop = 1 To (dscolumns / 2) - 1
                  e.Row.Cells(iLoop).Attributes.Add("colspan", "2")
                  If iLoop = 1 Then
                      e.Row.Cells(iLoop).Text = "Self"
                  Else
                      e.Row.Cells(iLoop).Text = "Child" &amp; iLoop - 2
                  End If
              Next
              e.Row.Cells(iLoop).Text = "Total"
          ElseIf e.Row.RowType = DataControlRowType.DataRow Then
              For iLoop = 1 To dscolumns - 2
                  If iLoop Mod 2 &lt;&gt; 0 Then
                      e.Row.Cells(iLoop + 1).Text = Format(IIf(CInt(e.Row.Cells(iLoop).Text) &lt;&gt; 0, (CInt(e.Row.Cells(iLoop).Text) / value) * 100, 0), "0.00") &amp; "%"
                      If CInt(e.Row.Cells(iLoop).Text) &lt;&gt; 0 Then
                          e.Row.Cells(iLoop).Controls.Add(lbtnCountDetails)
                          lbtnCountDetails.Text = e.Row.Cells(iLoop).Text
                          lbtnCountDetails.CommandArgument = "strstatus"
                          lbtnCountDetails.Attributes.Add("OnClick", "lbtnCountDetails_Click")
                      End If
                  End If
              Next
          End If
      End Sub
  </code></pre>
  
  <p>'Click event is here</p>
  
  <pre><code>Protected Sub lbtnCountDetails_Click(ByVal sender As Object, ByVal e As EventArgs)
          Dim strStatus As String = CType(sender, LinkButton).CommandArgument
      End Sub
  </code></pre>