title: Call function on button click event
body: <p>How do I call this vb.net function on the button click event?</p>
  
  <pre><code>Private Sub GridView_UDGReport_DataBound1(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.DataBound
  
      For rowIndex As Integer = GridView_UDGReport.Rows.Count - 2 To 0 Step -1
          Dim gviewRow As GridViewRow = GridView_UDGReport.Rows(rowIndex)
          Dim gviewPreviousRow As GridViewRow = GridView_UDGReport.Rows(rowIndex + 1)
          For cellCount As Integer = 0 To gviewRow.Cells.Count - 1
              If gviewRow.Cells(cellCount).Text = gviewPreviousRow.Cells(cellCount).Text Then
                  If gviewPreviousRow.Cells(cellCount).RowSpan &lt; 2 Then
                      gviewRow.Cells(cellCount).RowSpan = 2
                  Else
                      gviewRow.Cells(cellCount).RowSpan = gviewPreviousRow.Cells(cellCount).RowSpan + 1
                  End If
                  gviewPreviousRow.Cells(cellCount).Visible = False
              End If
          Next
      Next
  End Sub
  </code></pre>